|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32290 call_user_func_array() calls wrong class method within child class
Submitted: 2005-03-13 13:04 UTC Modified: 2005-03-13 14:26 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: ladoo at gmx dot at Assigned: helly (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5.0.3 OS: *
Private report: No CVE-ID: None
 [2005-03-13 13:04 UTC] ladoo at gmx dot at
I have a class A and a class B which extends A. Both have a equally named method. When I try to call A::method with call_user_func_array it calls B::method instead.

Reproduce code:
class A {
	public function doSomething($i)
		return --$i;

class B extends A {
	public function doSomething($i)
		if ($i >= 100) return 100;
		return call_user_func_array(array("A","doSomething"), array($i));
$x = new B();
echo $x->doSomething(1);

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-13 14:26 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Aug 03 21:01:24 2020 UTC