Hello Stanislav, Tuesday, July 22, 2008, 11:07:58 PM, you wrote:
> Hi! >> Can't we change zend_std_get_method() to return a zend_internal_function >> struct in case of a closure on a property? The only thing that needs to > That means that: > 1. We can't have properties named same as functions anymore 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. > 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. > 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. > 4. zend_std_get_method should be calling __get too, in case this > property is not a direct property! Maybe. However this only applies to overloaded objects. Maybe those cannot or should not hold closures. > I don't think it's going to work out. Using __invoke is much easier. > -- > Stanislav Malyshev, Zend Software Architect > [EMAIL PROTECTED] http://www.zend.com/ > (408)253-8829 MSN: [EMAIL PROTECTED] Best regards, Marcus -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php