[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-qa
Subject:    [PHP-QA] Bug #72002 [Com]: incorrect debug_backtrace() args
From:       "flip101 at gmail dot com" <php-bugs () lists ! php ! net>
Date:       2016-04-12 7:02:54
Message-ID: 201604120702.u3C72smR020207 () sgrv20 ! php ! net
[Download RAW message or body]

Edit report at https://bugs.php.net/bug.php?id=72002&edit=1

 ID:                 72002
 Comment by:         flip101 at gmail dot com
 Reported by:        flip101 at gmail dot com
 Summary:            incorrect debug_backtrace() args
 Status:             Wont fix
 Type:               Bug
 Package:            Testing related
 Operating System:   Windows 10 64bits
 PHP Version:        7.0.5
 Block user comment: N
 Private report:     N

 New Comment:

Performance is not relevant when debugging. Would be nice to have the option \
available to set php in such a way that debug_backtrace() gives the expected result.


Previous Comments:
------------------------------------------------------------------------
[2016-04-11 23:33:21] nikic@php.net

PHP 7 does not retain original arguments for performance reasons. This is intentional \
and will not be fixed.

------------------------------------------------------------------------
[2016-04-11 15:39:25] flip101 at gmail dot com

Description:
------------
On PHP 7.0.4 the args in debug_backtrace() do not give the correct arguments at the \
time of the call.

Test script:
---------------
<?php
function foo($var) {
  array_shift($var);
  var_dump(debug_backtrace());
}
$bar = ['a'];
foo($bar);

Expected result:
----------------
array(1) {
  [0]=>
  array(4) {
    ["file"]=>
    string(11) "test.php"
    ["line"]=>
    int(8)
    ["function"]=>
    string(3) "foo"
    ["args"]=>
    array(1) {
      [0]=>
      array(0) {
        [0]=>
        string(1) "a"
      }
    }
  }
}

Actual result:
--------------
array(1) {
  [0]=>
  array(4) {
    ["file"]=>
    string(11) "C:\test.php"
    ["line"]=>
    int(8)
    ["function"]=>
    string(3) "foo"
    ["args"]=>
    array(1) {
      [0]=>
      &array(0) {
      }
    }
  }
}


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=72002&edit=1

-- 
PHP Quality Assurance Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic