Re: Property Accessors 1.2 : parent::$foo Issue

From: Date: Fri, 04 Jan 2013 15:28:01 +0000
Subject: Re: Property Accessors 1.2 : parent::$foo Issue
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
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 "like a variable..."

$parent->foo

On 1/4/2013 5:09 AM, Clint Priest wrote:
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 <[email protected]> wrote:
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 <[email protected]> wrote:
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. In any case, better not to add another inconsistency to the list of existing ones. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
-- -Clint

Thread (52 messages)

« previous php.internals (#64524) next »