I had a quick question about this. When would strlen('abcd') be execuated? Say I had the code:

$a = false; // This set by external input
if ( $a )
 $b = strlen('abcd');

Would the optimizer work out the length before the program starts to run? Or would the optimizer wait until it knows the strlen is going to be called then convert it to the constant 4?

That's not my problem.. My RFC is about making the information available, not writing the optimizer itself (at least for now). With a naive optimizer, strlen() would be called, yes.

I could see the optimizer "constifying" many function calls which will never get called.

that's not a problem since you would use a cache..

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

Reply via email to