Jump to content

Where did the term "T_STRING" originate for PHP?


mrherman

Recommended Posts

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.

 

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".

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.

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.

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.