#31582 [Ana->WFx]: extended overload classes not honouring overload

From: Date: Wed, 02 Feb 2005 16:17:37 +0000
Subject: #31582 [Ana->WFx]: extended overload classes not honouring overload
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-73284@lists.php.net to get a copy of this message
ID: 31582 Updated by: sniper@php.net Reported By: alan_k@php.net -Status: Analyzed +Status: Wont fix Bug Type: Scripting Engine problem Operating System: linux PHP Version: 4CVS-2005-01-17 New Comment: Workaround exists -> won't fix. Previous Comments: ------------------------------------------------------------------------ [2005-02-02 16:32:00] stas@php.net 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. ------------------------------------------------------------------------ [2005-01-20 00:59:59] sniper@php.net Yet another overload bug..Stas, can you look into this too? ------------------------------------------------------------------------ [2005-01-17 11:39:23] alan_k@php.net 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(); ------------------------------------------------------------------------ [2005-01-17 11:36:12] 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 .... ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=31582&edit=1

« previous php.bugs (#73284) next »