Hi!

Nope. It means if you have a function named foo and a property foo that
sores a closure and then call foo(), then obviously the function is called
rather than the closure.

That means you can't call the closure, and nothing alerts you of the problem.

2. We'd have to check properties every time method name was not found

We could add a flag for this to make it faster. That is whenever someone
sets a property to a closure.

Whenever someone sets a property to a closure what happens? Does it mean that every call to write_property argument would be checked for instanceof Closure? What about write_dimension or get_property_ptr_ptr?

3. __call will be broken - now should we check properties or go to __call when method is not defined?

How is it broken? __call does not get called if there is something callable
already.

__call doesn't work anymore if there's a property with the name that is equal to called function. That could be a big surprise for classes that use __call for routing.

Maybe. However this only applies to overloaded objects. Maybe those cannot
or should not hold closures.

What do you mean by "overloaded objects"? Every object has get_property handler.
--
Stanislav Malyshev, Zend Software Architect
[EMAIL PROTECTED]   http://www.zend.com/
(408)253-8829   MSN: [EMAIL PROTECTED]

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

Reply via email to