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

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to