Re: debug_backtrace bug?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The 'class' index reflects what __CLASS__ constant would show. Bug report:

http://bugs.php.net/22960

Status: It works as expected and intended.

Thomas Peri wrote:
I wanted to run this past the list before submitting a bug report. (I've searched the bugs and haven't found anything relevant to my problem.)

The problem is that when s method of one class is overridden in a subclass, debug_backtrace() doesn't distinguish between the two methods. For example, this 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();


...produces this output:

    B::__construct
    B::__construct

...instead of the output I'd expect:

    A::__construct
    B::__construct

It happens for regular methods also, not just constructors. Is this a bug, or is this behavior correct for some reason? (Tested in php 5.0.0, 5.0.1, and 5.0.2)

Thanks.

Thomas


-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux