Re: Standard constants as part of the lexer

From: Date: Mon, 20 Jun 2011 17:17:51 +0000
Subject: Re: Standard constants as part of the lexer
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-53435@lists.php.net to get a copy of this message
Hi! On 6/20/11 4:12 AM, Robert Eisele wrote:
I think it depends on the experience of the developers. There are many - halfway ugly - "PHP optimization" tricks on the net. If these are used, the difference wouldn't that much. But constructs like for($i=0; $i<strlen($x); $i++) could get optimized vigorous.
If you're microoptimizing, you should not do this unless $x is a dynamic string, so I'm not sure messing with strlen is the right way to improve it. Also, I really do not like splitting strlen()/count() code into two places. It hurts maintainability and will lead to weird BC problems. I'm not sure if the optimization is worth it, but if it is, it should be done differently, with only one code for any strlen()/count() implementation. Also, I don't see why strlen/count should share an opcode if there's absolutely no common implementation code between them. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227

« previous php.internals (#53435) next »