What is a token, which is a simple assignment (=) in PHP?

I expected to find a simple T_EQUALor T_ASSIGNas a token for = here in the list of tokens of the PHP parser , but it does not exist.

What token is used to express an assignment operation? Let's say I have it $x = 1;, starts with T_VARIABLE, then T_WHITESPACE, then =, followed by any token, the number falls under, and then ends with ;. What token is used to represent these characters?

+4
source share
1 answer

If you run this code:

var_dump(token_get_all('<?php $foo = "bar"; ?>'));

You will see that =and ;are not tokens.

PHP , token_get_all "... (.. ;, ., , ! ..) , 0, 1 2." , , - .

, , Parser, T_NS_SEPARATOR (.. ) . , PHP C, C, , (.. "\\"), . .

+3

All Articles