note 103967 deleted from language.oop5.visibility by danbrown
| From: | danbrown@php.net | Date: | Sat, 14 May 2011 14:23:09 +0000 |
| Subject: | note 103967 deleted from language.oop5.visibility by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-179720@lists.php.net to get a copy of this message | ||
Note Submitter: Kvack
----
In response to ryan dot m dot lange at gmail dot com.
The output of $child2->foo() and $child2->bar() is not strange.
$child2->foo() outputs nothing because private property $foo of class Parent is never set since
Parents contructor isn't called.
$child2->bar() does not output the contents $foo in class Parent. It rather output the contents
of a (new) property $foo in class ChildClass2.
If adding a parent::__construct() to ChildClass2 constructor, result would perhaps be more obvious.