|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-03-13 14:26 UTC] helly@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 10:00:01 2025 UTC |
Description: ------------ 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) { $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: ---------------- 1 Actual result: -------------- 100