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. Link to comment https://forums.phpfreaks.com/topic/262888-where-did-the-term-t_string-originate-for-php/ 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 Link to comment https://forums.phpfreaks.com/topic/262888-where-did-the-term-t_string-originate-for-php/#findComment-1347445 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. Link to comment https://forums.phpfreaks.com/topic/262888-where-did-the-term-t_string-originate-for-php/#findComment-1347459 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). Link to comment https://forums.phpfreaks.com/topic/262888-where-did-the-term-t_string-originate-for-php/#findComment-1347464 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. Link to comment https://forums.phpfreaks.com/topic/262888-where-did-the-term-t_string-originate-for-php/#findComment-1347502 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". Link to comment https://forums.phpfreaks.com/topic/262888-where-did-the-term-t_string-originate-for-php/#findComment-1347563 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. Link to comment https://forums.phpfreaks.com/topic/262888-where-did-the-term-t_string-originate-for-php/#findComment-1347567 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. Link to comment https://forums.phpfreaks.com/topic/262888-where-did-the-term-t_string-originate-for-php/#findComment-1347606 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. Link to comment https://forums.phpfreaks.com/topic/262888-where-did-the-term-t_string-originate-for-php/#findComment-1347615 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. Link to comment https://forums.phpfreaks.com/topic/262888-where-did-the-term-t_string-originate-for-php/#findComment-1347616 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! Link to comment https://forums.phpfreaks.com/topic/262888-where-did-the-term-t_string-originate-for-php/#findComment-1347674 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.