#34986 [Opn]: New object field for debug_backtrace() result

From: Date: Wed, 26 Oct 2005 07:40:50 +0000
Subject: #34986 [Opn]: New object field for debug_backtrace() result
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-87054@lists.php.net to get a copy of this message
ID: 34986 User updated by: sebastian@php.net Reported By: sebastian@php.net Status: Open Bug Type: Feature/Change Request Operating System: Irrelevant PHP Version: 5.1.0RC3 New Comment: Just a clarification: [object] should contain a reference to the object, not an "Object id #x" string. That is only in the example output as that is what would happen for print_r(debug_backtrace()). Previous Comments: ------------------------------------------------------------------------ [2005-10-26 06:53:59] sebastian@php.net Description: ------------ For some Meta Programming it would be great if debug_backtrace() could return an [object] field (in addition to [class] that contains a reference to respective object. Reproduce code: --------------- <?php class A { private $b; public function __construct() { $this->b = new B; } public function aMethod() { $this->b->bMethod(); } } class B { public function bMethod() { print_r(debug_backtrace()); } } $a = new A; $a->aMethod(); ?> Expected result: ---------------- Array ( [0] => Array ( [file] => /home/sb/test.php [line] => 10 [function] => bMethod [class] => B [object] => <Object id #2> [type] => -> [args] => Array ( ) ) [1] => Array ( [file] => /home/sb/test.php [line] => 21 [function] => aMethod [class] => A [object] => <Object id #1> [type] => -> [args] => Array ( ) ) ) Actual result: -------------- Array ( [0] => Array ( [file] => /home/sb/test.php [line] => 10 [function] => bMethod [class] => B [type] => -> [args] => Array ( ) ) [1] => Array ( [file] => /home/sb/test.php [line] => 21 [function] => aMethod [class] => A [type] => -> [args] => Array ( ) ) ) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=34986&edit=1

« previous php.bugs (#87054) next »