Hi!

> As I understand correctly the only reason we have this discussion is
> the performance impact of zpp with some functions, mainly
> ZEND_FUNCTIONs. What prevents us to make them operators? That may
> break things like  call_user_func("strlen", $arg), array_map and the

There's also an issue that strlen("foo") may mean a different thing if
you're in a namespace. So there may be a challenge to do this on
compiler level, at least in the obvious way. But maybe there's a way
around it, so theoretically we could make compiler treat strlen() as
operator, or, more precisely, as an inline function looking like C
function with parameters passed in registers. I.e., what I mean is
skipping the whole parameter-passing and receiving altogether and just
give it the slot where the variable lives. Of course, it would work only
with strlen() and such which do not modify the argument and hardly do
anything with it at all, and strlen would essentially have to have two
implementations - one for "inline" usage and one for "normal" usage
($foo(), call_user_func(), etc.). But since 99% of actual usage would be
"inline" it may still be beneficial.

-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/

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

Reply via email to