Hi all, I changed things so that the many "built-in" constants (CONST_PERSISTENT ones) will be replaced at compile-time, saving the FETCH_CONSTANT opcode, if these changes are usable. This was added for TRUE/FALSE/NULL 2 years ago, but seems like it can be done for "lots" of others too.
Since the change 2 years ago, other constants have been getting looked up also, but just discarded. And if a constant wasn't found, its name was lowercased and looked up again (for case-insensitive TRUE/FALSE/NULL). Lowercasing has been removed, since case-insensitive constants can't be done (guess an exception was made for TRUE/FALSE/NULL :-)), and TRUE/FALSE/NULL get flagged in the scanner (not reserved words, which Marcus did briefly a few years ago), skipping a hash lookup. BTW, to get this compile-time optimization in a namespace, it needs to be prefixed (::CONSTANT). I also removed an unnecessary memcmp() in zend_get_constant() -- old code that was needed a long time ago, it appears. http://realplain.com/php/const_ct_optimization.diff http://realplain.com/php/const_ct_optimization_5_3.diff Thoughts? Thanks, Matt -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php