|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33277 private method accessed by child class
Submitted: 2005-06-08 18:32 UTC Modified: 2005-06-17 12:51 UTC
From: Assigned: stas (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5CVS-2005-06-08 (dev) OS: *
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.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2005-06-08 18:32 UTC]
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() {
class foo2son extends fooson {
        function bar() {
                echo "public!\n";
$b = new foo2son();

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-17 12:51 UTC]
Fixed in CVS HEAD and PHP_5_0.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Sep 26 10:03:36 2021 UTC