|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #53826 __callStatic fired in base class through a parent call if the method is private
Submitted: 2011-01-24 01:24 UTC Modified: -
Avg. Score:4.0 ± 0.5
Reproduced:7 of 7 (100.0%)
Same Version:1 (14.3%)
Same OS:1 (14.3%)
From: ingun at live dot fr Assigned:
Status: Closed Package: Class/Object related
PHP Version: 5.3.5 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
25 + 24 = ?
Subscribe to this entry?

 [2011-01-24 01:24 UTC] ingun at live dot fr
In a base class, a private non static method called by an extended class with 
triggers __callStatic, while __call could have been expected.

If this private method is not defined at all, __call is triggered. (which seems 
right according to )

The same behaviour for both cases should be suitable.

Test script:
class A1 {
	public function __call($method, $args) { echo "__call";	}
	public static function __callStatic($method, $args) { echo "__callStatic"; }

class A2 { // A1 with private function test
	public function __call($method, $args) { echo "__call";	}
	public static function __callStatic($method, $args) { echo "__callStatic"; }	
	private function test() {}

class B1 extends A1 {
	public function test(){	parent::test();	}

class B2 extends A2 {
	public function test(){	parent::test();	}

$test1 = new B1;
$test2 = new B2;

Expected result:

// or __callStatic__callStatic, but the same behaviour for both

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-02-18 13:17 UTC]
Automatic comment on behalf of
Log: Fixed bug #53826
 [2021-02-18 13:17 UTC]
-Status: Open +Status: Closed
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 14 04:01:27 2024 UTC