Hi,

On 1/14/2009 18:29, Stanislav Malyshev wrote:
Hi!

That is one example of convoluted code that is already possible. If a developer creates such a mess is his fault.

"Convoluted"? "Mess"? Are you kidding me? It's standard usage of access handlers.
I don't understand how that could be standard when the example was about calling overloaded properties, which isn't yet possible in the language, as you vigilantly observed.

Now, regardless whether is convoluted or not, you must agree that is better having callable properties in the language and documenting that this won't apply for overloaded properties. In the end you don't really need callable overloaded properties as a developer already has access to the internals of a class, thus __call() is all he needs to implement them (there would be at least a magic call anyway). It's a trade off but a worthy one in my opinion. Just as right now it is being documented that in order to call a lambda assigned to an instance property you need a temporary variable, it could be easily documented that one should not expect callable overloaded properties and must instead implement __call beside the standard __get/__set. It's a WTF but a smaller one this time. Anyway, there may be stronger arguments against so I'm interested in your opinion.

Thanks,
I. Stan


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

Reply via email to