Bug #72002 [Com]: incorrect debug_backtrace() args
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
Thread (3 messages)