#30828 [Ver->Csd]: debug_backtrace() reports incorrect class in overridden methods

From: Date: Thu, 23 Jun 2005 09:25:10 +0000
Subject: #30828 [Ver->Csd]: debug_backtrace() reports incorrect class in overridden methods
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-80887@lists.php.net to get a copy of this message
ID: 30828 Updated by: dmitry@php.net Reported By: lists at infospleen dot com -Status: Verified +Status: Closed Bug Type: Zend Engine 2 problem Operating System: * PHP Version: 5CVS-2005-06-19 -Assigned To: +Assigned To: dmitry New Comment: Fixed in CVS HEAD and PHP_5_0. Previous Comments: ------------------------------------------------------------------------ [2005-01-07 13:39:43] vargusz at freemail dot hu Possibly the same underlying code causes inherited static method calls to be misreported: class A { static function f () { $bt = debug_backtrace(); echo "{$bt['class']}\n"; } } class B extends A {} And both A::f() and B::f() produce 'A'. ------------------------------------------------------------------------ [2004-11-18 16:32:47] lists at infospleen dot com Description: ------------ If class B extends class A, and overrides a method of class A, debug_backtrace() reports that the method of class A is a method of class B instead. Reproduce code: --------------- class A { function __construct() { $bt = debug_backtrace(); foreach ($bt as $t) print $t['class'].'::'. $t['function'].'<br>'; } } class B extends A { function __construct() { parent::__construct(); } } $b = new B(); Expected result: ---------------- Expected output: A::__construct B::__construct Actual result: -------------- Actual output: B::__construct B::__construct ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30828&edit=1

« previous php.bugs (#80887) next »