#34060 [Opn->Csd]: PHP5 OOP Visibility does not fully document protected constriants

From: Date: Mon, 29 Aug 2005 15:52:09 +0000
Subject: #34060 [Opn->Csd]: PHP5 OOP Visibility does not fully document protected constriants
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969369755@lists.php.net to get a copy of this message
ID: 34060 Updated by: vrana@php.net Reported By: david dot tulloh at anu dot edu dot au -Status: Open +Status: Closed Bug Type: Documentation problem PHP Version: Irrelevant New Comment: This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. Changed to "Protected limits access to inherited and parent classes (and to the class that defines the item)." Previous Comments: ------------------------------------------------------------------------ [2005-08-10 03:02:10] david dot tulloh at anu dot edu dot au Description: ------------ The first paragraph includes the following description of protected: "Protected limits access to inherited classes (and to the class that defines the item)." However it actually allows access from functions in both the parent and child classes. I've provided some example code. Reproduce code: --------------- <?php class aParent { function get_a () { echo $this->a; } } class aChild extends aParent { protected $a = "hi"; } $my_obj = new aChild(); $my_obj->get_a(); # Prints hi ?> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=34060&edit=1

« previous php.doc (#969369755) next »