#30828 [NEW]: debug_backtrace reports incorrect class in overridden methods

From: Date: Thu, 18 Nov 2004 15:32:48 +0000
Subject: #30828 [NEW]: debug_backtrace reports incorrect class in overridden methods
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-69219@lists.php.net to get a copy of this message
From:             lists at infospleen dot com
Operating system: 
PHP version:      5.0.1
PHP Bug Type:     Scripting Engine problem
Bug description:  debug_backtrace reports incorrect class in overridden methods

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 bug report at http://bugs.php.net/?id=30828&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=30828&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30828&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30828&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=30828&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=30828&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=30828&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=30828&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=30828&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=30828&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=30828&r=notwrong
Not enough info:             http://bugs.php.net/fix.php?id=30828&r=notenoughinfo
Submitted twice:             http://bugs.php.net/fix.php?id=30828&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=30828&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=30828&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=30828&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=30828&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=30828&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=30828&r=float
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=30828&r=mysqlcfg


Thread (4 messages)

« previous php.bugs (#69219) next »