For Programmers: Free Programming Magazines  


Home > Archive > PHP Documentation > August 2005 > #34060 [Opn->Csd]: PHP5 OOP Visibility does not fully document protected constrian









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author #34060 [Opn->Csd]: PHP5 OOP Visibility does not fully document protected constrian
vrana@php.net

2005-08-29, 6:56 pm

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
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com