#37654 [Opn->WFx]: covering private method
| From: | tony2001@php.net | Date: | Wed, 31 May 2006 15:38:16 +0000 |
| Subject: | #37654 [Opn->WFx]: covering private method | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-97867@lists.php.net to get a copy of this message | ||
ID: 37654
Updated by: tony2001@php.net
Reported By: mjarco at zhr dot pl
-Status: Open
+Status: Wont fix
Bug Type: Scripting Engine problem
Operating System: Windows/Linux
PHP Version: 5.1.4
New Comment:
This is called "late static binding" and we're still thinking on the
best implementaion of it.
Until then -> won't fix.
Previous Comments:
------------------------------------------------------------------------
[2006-05-31 15:24:07] mjarco at zhr dot pl
Description:
------------
I think there is a bug when you want to cover private method in child
class, and run it by public inherited method. See example:
Reproduce code:
---------------
class Bar
{
private function shmoo()
{
print 'bar';
}
public function exe()
{
$this->shmoo();
}
}
class FooBar extends Bar
{
//change to protected, and public see what happens
private function shmoo()
{
print 'foobar';
}
}
$bar = new FooBar;
$bar->exe();
Expected result:
----------------
foobar
Actual result:
--------------
bar
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37654&edit=1