#33277 [Asn->Csd]: private method accessed by child class

From: Date: Fri, 17 Jun 2005 10:51:50 +0000
Subject: #33277 [Asn->Csd]: private method accessed by child class
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-80531@lists.php.net to get a copy of this message
ID: 33277 Updated by: dmitry@php.net Reported By: stas@php.net -Status: Assigned +Status: Closed Bug Type: Zend Engine 2 problem Operating System: * PHP Version: 5CVS-2005-06-08 (dev) Assigned To: stas New Comment: Fixed in CVS HEAD and PHP_5_0. Previous Comments: ------------------------------------------------------------------------ [2005-06-08 18:32:43] stas@php.net Description: ------------ Code below produces "private!" - meaning that object is allowed to access private methods of the parent class, which is, of course, wrong. Reproduce code: --------------- <? class foo { private function bar() { echo "private!\n"; } } class fooson extends foo { function barson() { $this->bar(); } } class foo2son extends fooson { function bar() { echo "public!\n"; } } $b = new foo2son(); $b->barson(); ?> Expected result: ---------------- public! Actual result: -------------- private! ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=33277&edit=1

« previous php.bugs (#80531) next »