Re: [PHP-DEV] [PHP-RFC] Property Accessors 1.2 : parent::$foo Issue

2013-01-13 Thread Clint Priest
On 1/13/2013 8:01 AM, Mark wrote: I'm guessing this RFC won't make it in PHP 5.5? Too bad since it did seem like a very nice feature to have. I don't know if it is very helpful but posting nevertheless. I'm a C++/Qt/QML/PHP developer and for me the proposed syntax in the v1.2 document makes per

Re: [PHP-DEV] [PHP-RFC] Property Accessors 1.2 : parent::$foo Issue

2013-01-13 Thread Mark
On Fri, Jan 11, 2013 at 8:08 AM, Stas Malyshev wrote: > Hi! > >> Re the ReflectionProperty::getParentProperty($this, 'foo') suggestion, >> is this supposed to already get the value of the property (and there >> would be an additional method ReflectionProperty::setParentProperty)? > > I meant getti

Re: [PHP-DEV] [PHP-RFC] Property Accessors 1.2 : parent::$foo Issue

2013-01-10 Thread Stas Malyshev
Hi! > Re the ReflectionProperty::getParentProperty($this, 'foo') suggestion, > is this supposed to already get the value of the property (and there > would be an additional method ReflectionProperty::setParentProperty)? I meant getting the ReflectionProperty class, but getting the actual value is

Re: [PHP-DEV] [PHP-RFC] Property Accessors 1.2 : parent::$foo Issue

2013-01-10 Thread Clint Priest
On 1/10/2013 6:57 PM, Nikita Popov wrote: Even more generic, we just could use existing ReflectionProperty like this (this is standard API, no changes needed): (new ReflectionProperty(get_parent_class(), 'foo'))->setValue($this, $val); Yes, this is even more long-winded, that'

Re: [PHP-DEV] [PHP-RFC] Property Accessors 1.2 : parent::$foo Issue

2013-01-10 Thread Steve Clay
Why we must have parent property access at all? What's the use case and how do other langs do it? Am I right to say there is no "parent property", this would just call the parent's [gs]etter using the same underlying property value? Steve -- http://www.mrclay.org/ On Jan 10, 2013, at 6:15 PM,

Re: [PHP-DEV] [PHP-RFC] Property Accessors 1.2 : parent::$foo Issue

2013-01-10 Thread Nikita Popov
On Fri, Jan 11, 2013 at 1:03 AM, Stas Malyshev wrote: > > 3) My suggestion is to avoid the engine and syntax related issues of > > parent property access by putting this as a function in the standard > > library instead. What I'm thinking about is a function like > > get_parent_property() which re

Re: [PHP-DEV] [PHP-RFC] Property Accessors 1.2 : parent::$foo Issue

2013-01-10 Thread Stas Malyshev
Hi! > 1) I tried to understand how the engine currently compiles and executes > object property fetches. I found it to be incredibly complex and I > certainly don't have the abilities to port this for statics. As such the > "parent::$foo" syntax is dead unless someone else is going to do the > nec

Re: [PHP-DEV] [PHP-RFC] Property Accessors 1.2 : parent::$foo Issue

2013-01-10 Thread Nikita Popov
On Sat, Jan 5, 2013 at 4:25 AM, Clint Priest wrote: > Agreed. Some people may actually be using $parent as a variable name, not > difficult to imagine. > > So far parent->foo seems to be the answer. > > -Clint > My thoughts on the parent situations, as I'm not yet satisfied with the current sol

Re: [PHP-DEV] [PHP-RFC] Property Accessors 1.2 : parent::$foo Issue

2013-01-04 Thread Clint Priest
Agreed. Some people may actually be using $parent as a variable name, not difficult to imagine. So far parent->foo seems to be the answer. -Clint On 1/4/2013 4:23 PM, Stas Malyshev wrote: Hi! One other possible alternative would be to treat parent "like a variable..." $parent->foo That w

Re: [PHP-DEV] [PHP-RFC] Property Accessors 1.2 : parent::$foo Issue

2013-01-04 Thread Stas Malyshev
Hi! > One other possible alternative would be to treat parent "like a variable..." > > $parent->foo That would be a big BC problem and also require serious changes to handle it (look how $this is implemented - it's not regular variable at all). So $parent is probably a non-starter. -- Stanislav

Re: [PHP-DEV] [PHP-RFC] Property Accessors 1.2 : parent::$foo Issue

2013-01-04 Thread Lars Strojny
Hi Clint, got it. Am 04.01.2013 um 16:28 schrieb Clint Priest : > Uhm.. brain fart. > > I was thinking $this->$foo was normal when I wrote this up, I would change my > last statement from the earlier email to any syntax which did not include a $. > > That being said then, I think I favor par

Re: [PHP-DEV] [PHP-RFC] Property Accessors 1.2 : parent::$foo Issue

2013-01-04 Thread Clint Priest
Uhm.. brain fart. I was thinking $this->$foo was normal when I wrote this up, I would change my last statement from the earlier email to any syntax which did not include a $. That being said then, I think I favor parent->foo the best. One other possible alternative would be to treat parent "

Re: [PHP-DEV] [PHP-RFC] Property Accessors 1.2 : parent::$foo Issue

2013-01-04 Thread Lars Strojny
Hi Clint, Am 04.01.2013 um 04:13 schrieb Clint Priest : [...] > 1) It forces the user to access the parent property accessor in a different > way than is used everywhere else Isn’t that the same as parent->$foo? Please let’s not introduce a special syntax for something that can be done proper

Re: [PHP-DEV] [PHP-RFC] Property Accessors 1.2 : parent::$foo Issue

2013-01-04 Thread Clint Priest
Speaking of which, parent::foo ( with :: but no $) might work as well, almost *any* character change could work... parent:::$foo parent:$foo parent->$foo parent->foo parent.$foo parent.foo I favor having the $ in some solution though... -Clint On Jan 4, 2013, at 5:04 AM, Clint Priest wrote:

Re: [PHP-DEV] [PHP-RFC] Property Accessors 1.2 : parent::$foo Issue

2013-01-04 Thread Clint Priest
Missed that bit... I think that would add two bits of inconsistency though... (Without the $) -Clint On Jan 4, 2013, at 1:18 AM, Stas Malyshev wrote: > Hi! > >> A recent suggestion from Stas is to use parent->$foo (note the use of -> >> rather than ::) > > I actually proposed parent->foo.

Re: [PHP-DEV] [PHP-RFC] Property Accessors 1.2 : parent::$foo Issue

2013-01-03 Thread Stas Malyshev
Hi! > A recent suggestion from Stas is to use parent->$foo (note the use of -> > rather than ::) I actually proposed parent->foo. parent->$foo implies the name of the variable is "$foo", not "foo" - just as in $this->$foo. Yes, I know it does not match parent::$foo - but I can't do much about it

Re: [PHP-DEV] [PHP-RFC] Property Accessors 1.2 : parent::$foo Issue

2013-01-03 Thread Clint Priest
Note, there has been a show stopper of an issue with the current RFC that many minds have been talking about how to solve. The problem is with parent::$foo accessing the parent accessor. In summary, the difficulty is that this is parsed as a static property access and during compilation there