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.

 

Link to comment
Share on other sites

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
Share on other sites

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
Share on other sites

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.