#39111 [Opn->Bgs]: debug_backtrace() has problems with static classes

From: Date: Tue, 10 Oct 2006 14:00:40 +0000
Subject: #39111 [Opn->Bgs]: debug_backtrace() has problems with static classes
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-103373@lists.php.net to get a copy of this message
ID: 39111 Updated by: tony2001@php.net Reported By: vincent dot guth at gmail dot com -Status: Open +Status: Bogus Bug Type: Unknown/Other Function Operating System: * PHP Version: 5.1.6 New Comment: The function r() belongs to class A and is executed in its scope, so the result you get is expected. Previous Comments: ------------------------------------------------------------------------ [2006-10-10 12:15:22] vincent dot guth at gmail dot com Description: ------------ The "class" parameter should be "B" instead of "A", as I called B::r() and not A::r(). Reproduce code: --------------- <?php abstract class A { public static function r() { var_dump(debug_backtrace()); } } class B extends A { } echo B::r(); ?> Expected result: ---------------- array(1) { [0]=> array(6) { ["file"]=> string(13) "/www/test.php" ["line"]=> int(12) ["function"]=> string(1) "r" ["class"]=> string(1) "B" /* Not A */ ["type"]=> string(2) "::" ["args"]=> array(0) { } } } Actual result: -------------- array(1) { [0]=> array(6) { ["file"]=> string(13) "/www/test.php" ["line"]=> int(12) ["function"]=> string(1) "r" ["class"]=> string(1) "A" ["type"]=> string(2) "::" ["args"]=> array(0) { } } } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=39111&edit=1

« previous php.bugs (#103373) next »