Well I guess this and many of the other issues from other threads are the reasons I had it written the way that it is currently (basically an extension of __get()) but numerous other proposals have muddied the situation.

On Sunday, October 28, 2012 2:17:47 AM, Stas Malyshev wrote:
Hi!

Sorry I guess I should have been more clear.  The recursion would
prevent the accessor from being called which would allow the ordinary
property code to execute, thus accessing the property directly.  I

This could lead to weird scenarios where the same $foo->bar in random
function could call or not call an accessor depending on the stack trace
(provided that accessors call out to other functions - which is not
frequent but can definitely happen). In case of __get it's harmless
since we know $foo->bar doesn't exist anyway, but if we do allow $bar to
exist in $foo it might get weird. I'd certainly appreciate some
notice/E_STRICT if this happens.
Maybe I'd go even as far as issuing E_STRICT on having both $bar and any
of the accessors for $bar in the same class - but this of course would
scream on the scenario of augmenting existing $bar with accessors -
which is legit, unless it gets weird as described above.

--
-Clint


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

Reply via email to