|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-01-17 11:36 UTC] alan_k@php.net
Description:
------------
the class of an overloaded class is not honouring the fact that it's parent is overloaded. (as per previous releases)
Reproduce code:
---------------
class ddo_base {
echo "METHOD: ".$method;
function __call($method,$args,&$return) {
return true;
}
}
class ddo extends ddo_test {
}
overload("ddo_base");
$x = new ddo_base;
$x->helloWorld();
$x = new ddo;
$x->helloWorld();
Expected result:
----------------
METHOD: ddo_testMETHOD: helloworldMETHOD: ddoMETHOD: helloworld
Actual result:
--------------
METHOD: ddo_testMETHOD: helloworld
Fatal error: Call to undefined function: helloworld() in ....
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 00:00:02 2025 UTC |
agh... try again.. class ddo_base { function __call($method,$args,&$return) { echo "METHOD:".$method; return true; } } class ddo extends ddo_base { } overload("ddo_base"); $x = new ddo_base; $x->helloWorld(); $x = new ddo; $x->helloWorld();Overload changes class' handlers, but not it's descendants' handlers. Thus, class "ddo" doesn't know about handlers for ddo_base. Simplest way to fix it would be to do: overload("ddo") Other way would be to make fcall opcode to traverse all object hierarchy in hope there would be handler somewhere, but it seems to be somewhat slow.