note 73556 added to language.oop5.visibility
| From: | atitthaker at gmail dot com | Date: | Thu, 01 Mar 2007 09:34:14 +0000 |
| Subject: | note 73556 added to language.oop5.visibility | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-123977@lists.php.net to get a copy of this message | ||
<?
class A
{
protected $b=20;
private $a=10;
//protected method and shall not be accessible under class C
protected function access()
{
print("here");
}
}
class B extends A
{
public function test()
{
$this->access() ;
}
}
class C extends B
{
function temp()
{
$this->access(); // access variable and prints "here"
}
}
$abc= new C();
$abc->temp();
?>
Above code shall generate error as protected method of class A is accessible in class C which is
directly not inheriting class A.
----
Server IP: 69.147.83.197
Probable Submitter: 220.227.67.130 (proxied: 192.168.1.210)
----
Manual Page -- http://www.php.net/manual/en/language.oop5.visibility.php
Edit -- https://master.php.net/note/edit/73556
Del: integrated -- https://master.php.net/note/delete/73556/integrated
Del: useless -- https://master.php.net/note/delete/73556/useless
Del: bad code -- https://master.php.net/note/delete/73556/bad+code
Del: spam -- https://master.php.net/note/delete/73556/spam
Del: non-english -- https://master.php.net/note/delete/73556/non-english
Del: in docs -- https://master.php.net/note/delete/73556/in+docs
Del: other reasons-- https://master.php.net/note/delete/73556
Reject -- https://master.php.net/note/reject/73556
Search -- https://master.php.net/manage/user-notes.php