From:             [EMAIL PROTECTED]
Operating system: Irrelevant
PHP version:      5.1.0RC3
PHP Bug Type:     Feature/Change Request
Bug description:  New object field for debug_backtrace() result

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 bug report at http://bugs.php.net/?id=34986&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=34986&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=34986&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=34986&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=34986&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=34986&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=34986&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=34986&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=34986&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=34986&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=34986&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=34986&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=34986&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=34986&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=34986&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=34986&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=34986&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=34986&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=34986&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=34986&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=34986&r=mysqlcfg

Reply via email to