ID: 30828
Updated by: [EMAIL PROTECTED]
Reported By: lists at infospleen dot com
-Status: Open
+Status: Verified
-Bug Type: Scripting Engine problem
+Bug Type: Zend Engine 2 problem
-Operating System:
+Operating System: *
-PHP Version: 5.0.1
+PHP Version: 5CVS-2005-02-28
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