ID: 39111
Updated by: [EMAIL PROTECTED]
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