What does the "T" in this PHP error
Parse error: syntax error, unexpected T_VARIABLE
mean?
(I know what the error itself means, but I would like to know why it's not only "VARIABLE".)
"T" stands for "token".
When PHP code is being run, the first step is called "lexical analysis" (or "lexing"). The lexer scans through the input text and produces a list of token objects instead. It's common (in many languages) to use names prefixed with T
for these.
The next step is to interpret these tokens, allowing them to be compiled or run directly. This is the first step where PHP cares about the order of tokens (in most cases), and so this is where you get the error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With