ID: 34060
Updated by: [EMAIL PROTECTED]
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