Re: what's a "T_VARIABLE" ?

From: Date: Thu, 01 Jan 1970 00:00:00 +0000
Subject: Re: what's a "T_VARIABLE" ?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-29527@lists.php.net to get a copy of this message
You are correct. T_VARIABLE is similar to a macro definition. The longer explanition follows: Errors in PHP can occur during either the compile or execute phase. The compile phase is when PHP reads the code. The routines that "read" the code are called parsers and tokenizers. The tokenizer looks at each "word" and tries to determine what kind of "word" it is. Each of these types has a number, but it is converted to a name so that it is easier to program. T_VARIABLE is a Token of type VARIABLE. When the parser gets the tokens it tries to make sense of them, and throws errors if it doesn't know what to do. If this was too much detail, I appologize. Thanks. Peter Bowen On Sat, 9 Dec 2000, Adam Wright wrote: > > ok, ok, I forgot the '$' but whats the error mean ? > > > > Parse error: parse error, expecting `T_VARIABLE' in > > > > is a helluva way of saying > > > > you forgot the '$' > > Not necessarily.. The error handling isn't *trying* to be easy to > understand - T_VARIABLE is probably just the macro definition for a string > (with characters allowed in a variable) with a $ in front of it, as defined > in the php source. More precise definitions of errors would slow php down > and bluk up the program - this puts the onus on the developer to be good :) >

« previous php.general (#29527) next »