php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37654 covering private method
Submitted: 2006-05-31 15:24 UTC Modified: 2006-05-31 15:38 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: mjarco at zhr dot pl Assigned:
Status: Wont fix Package: Scripting Engine problem
PHP Version: 5.1.4 OS: Windows/Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2006-05-31 15:24 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-05-31 15:38 UTC] tony2001@php.net
This is called "late static binding" and we're still thinking on the best implementaion of it.
Until then -> won't fix.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 02:01:29 2024 UTC