mrherman Posted May 21, 2012 Share Posted May 21, 2012 Just curious. Why the term "T_STRING?" Looked it up, but all I could find was that it is a very small pair of underwear. Quote Link to comment Share on other sites More sharing options...
smoseley Posted May 21, 2012 Share Posted May 21, 2012 that's a reference to an object / operator token coming from the PHP parser: http://php.net/manual/en/tokens.php Quote Link to comment Share on other sites More sharing options...
mrherman Posted May 22, 2012 Author Share Posted May 22, 2012 Ah, so it stands for token. Thanks for the pointer. I read some more about this (http://en.wikipedia.org/wiki/Lexical_analysis) and it is a pretty complicated subject. Quote Link to comment Share on other sites More sharing options...
smoseley Posted May 22, 2012 Share Posted May 22, 2012 I think the "T_" actually stands for "Type" (object or operator type). the full constant name is a "Token" (T_STRING). Quote Link to comment Share on other sites More sharing options...
kicken Posted May 22, 2012 Share Posted May 22, 2012 I think the "T_" actually stands for "Type" (object or operator type). the full constant name is a "Token" (T_STRING). No, the 'T' stands for token. That is why there is things like T_SL (<<), T_SR (>>) T_DOUBLE_ARROW (=>) and a whole lot others. Each individual operator or element of the PHP syntax is broken down into a token which the parser then breaks the source code up into for processing. Quote Link to comment Share on other sites More sharing options...
smoseley Posted May 22, 2012 Share Posted May 22, 2012 I think the "T_" actually stands for "Type" (object or operator type). the full constant name is a "Token" (T_STRING). No, the 'T' stands for token. That is why there is things like T_SL (<<), T_SR (>>) T_DOUBLE_ARROW (=>) and a whole lot others. Each individual operator or element of the PHP syntax is broken down into a token which the parser then breaks the source code up into for processing. If you actually read my post, I clearly state my understading that T_STRING is a "token" used by the parser. However, the fact that T_STRING is a token does not imply that "T" stands for "token". Quote Link to comment Share on other sites More sharing options...
scootstah Posted May 22, 2012 Share Posted May 22, 2012 If you actually read my post, I clearly state my understading that T_STRING is a "token" used by the parser. However, the fact that T_STRING is a token does not imply that "T" stands for "token". But there are many T_ tokens. If you conclude that the T stands for "type" in a token that happens to reference a type (in this case "string"), then what does the T stand for in things like T_EXIT, T_PRIVATE, T_NAMESPACE, etc? None of these are types. It is only logical that it means token. Quote Link to comment Share on other sites More sharing options...
smoseley Posted May 22, 2012 Share Posted May 22, 2012 If you actually read my post, I clearly state my understading that T_STRING is a "token" used by the parser. However, the fact that T_STRING is a token does not imply that "T" stands for "token". But there are many T_ tokens. If you conclude that the T stands for "type" in a token that happens to reference a type (in this case "string"), then what does the T stand for in things like T_EXIT, T_PRIVATE, T_NAMESPACE, etc? None of these are types. It is only logical that it means token. Per my initial post, I assumed "T" stood for object type (string, integer, etc.) or operator type (everything else). I don't htink you can say for certain that I'm wrong. We're both making assumptions as to the intentions of the devs. Quote Link to comment Share on other sites More sharing options...
smoseley Posted May 22, 2012 Share Posted May 22, 2012 Actually, in retrospect, I'm going to concede on that... I think you're right. Given that these tokens are constants, the T_ is a prefix that the devs used to identify them as a group. And as a group, they are tokens. So "T" probably stands for "token". Still, you can't say you know that for certain. And it's a minute detail not even worth arguing. Quote Link to comment Share on other sites More sharing options...
mrherman Posted May 22, 2012 Author Share Posted May 22, 2012 Every time I see it on the screen, there is an error. So, to me it means Trouble. Quote Link to comment Share on other sites More sharing options...
smoseley Posted May 22, 2012 Share Posted May 22, 2012 Every time I see it on the screen, there is an error. So, to me it means Trouble. LOL! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.