note 110850 deleted from language.operators.increment by danbrown

From: Date: Fri, 14 Dec 2012 18:39:05 +0000
Subject: note 110850 deleted from language.operators.increment by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-192538@lists.php.net to get a copy of this message
Note Submitter: f74 at nil ---- <?php in reply to previous note... class a { private $foo = 1; } class b extends a { public function inc() { echo ++$this->foo; } } $b = new b; $b->inc(); ?> $foo is private, so can't be accessed by its children. Simply change private for protected and ++$this->foo equals 2.

« previous php.notes (#192538) next »