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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mjarco at zhr dot pl
New email:
PHP Version: OS:

 

 [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: Thu Apr 25 16:01:28 2024 UTC