Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.c zend_compile.h zend_language_parser.y

From: Date: Thu, 10 Apr 2003 19:33:50 +0000
Subject: Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.c zend_compile.h zend_language_parser.y
References: 1  Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-1136@lists.php.net to get a copy of this message
On Thu, 2003-04-10 at 15:48, Andi Gutmans wrote: > Sterling, > This patch looks quite broken: Geeze. I have to commit to get your attention. ;-) > First of all the following doesn't seem to be trivial to fix. Following the > latest discussions on engine2@ I doubt someone would let you get away > without it :P > + | class_or_namespace_constant { /* FIXME */ } Its that way in the static_var, its just moved over. I can remove it if you like. > > Secondly, are you sure the regular constants work? It seems to me that it > won't work if the constant is defined in an include'd file because it won't > be available at compile-time. > "regular constant"? Do you mean define()? There's a discussion between Zeev and I in the archives. Basically: const is now a compile time feature. const can reference static constants but they must either be built-in php constants (true, false, error reporting), or they must be in the current class. Ie: class bar { const b = 13; } class foo { const a = 10; // Yo Yo const b = a | 12; // Yo Yo const c = bar::b | 12; // No! No! } > Last but not least, how about using switch in zend_do_fold_binary_op()? > Sure. -Sterling > Andi > > At 03:43 PM 4/10/2003 +0000, Sterling Hughes wrote: > >sterling Thu Apr 10 11:43:47 2003 EDT > > > > Modified files: > > /ZendEngine2 zend_compile.c zend_compile.h zend_language_parser.y > > Log: > > allow expressions within constants, so the following is possible > > > > class foo { > > const a = 1<<0; > > const b = 1<<1; > > const c = a | b; > > } > > > > this makes const a compile-time expression. all other operators are > > unaffected. > > > > > >-- > >Zend Engine CVS Mailing List (http://cvs.php.net/) > >To unsubscribe, visit: http://www.php.net/unsub.php -- "People can have the Model T in any colour -- so long as it's black." - Henry Ford

« previous php.zend-engine.cvs (#1136) next »