[PHP-DEV] [RFC] Property Accessors 1.2 : Shadowing

2012-10-26 Thread Clint Priest
I'm opening up several new threads to get discussion going on the remaining "being debated" categories referenced in this 1.1 -> 1.2 change spec: https://wiki.php.net/rfc/propertygetsetsyntax-as-implemented/change-requests Shadowing v1.1 has properties shadow accessors, the suggestion is that

Re: [PHP-DEV] [RFC] Property Accessors 1.2 : Shadowing

2012-10-26 Thread Stas Malyshev
Hi! > v1.2 Proposes that this be inverted such that if there is an accessor > defined for a given property name, the accessor will always be used. The > accessor would be able to get/set/isset/unset the property with the same > name as the accessor. No direct access to the property would be all

Re: [PHP-DEV] [RFC] Property Accessors 1.2 : Shadowing

2012-10-27 Thread Clint Priest
Recursion is guarded by the same mechanism __get uses to avoid recursion. On 10/26/2012 9:33 AM, Stas Malyshev wrote: Hi! v1.2 Proposes that this be inverted such that if there is an accessor defined for a given property name, the accessor will always be used. The accessor would be able to get

Re: [PHP-DEV] [RFC] Property Accessors 1.2 : Shadowing

2012-10-27 Thread Stas Malyshev
Hi! > Recursion is guarded by the same mechanism __get uses to avoid recursion. __get on recursion returns undefined, __set on recursion does nothing. However you're saying "No direct access to the property would be allowed except from within the accessor" - but what this not allowing means? Just

Re: [PHP-DEV] [RFC] Property Accessors 1.2 : Shadowing

2012-10-27 Thread Clint Priest
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 suppose if it were in a setter and the property were not defined by the accessor then it wou

Re: [PHP-DEV] [RFC] Property Accessors 1.2 : Shadowing

2012-10-28 Thread Stas Malyshev
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 co

Re: [PHP-DEV] [RFC] Property Accessors 1.2 : Shadowing

2012-10-28 Thread Clint Priest
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