Bug #79827 [Com]: debug_backtrace() does not return passed args
| From: | michael dot vorisek at email dot cz | Date: | Fri, 10 Jul 2020 19:00:31 +0000 |
| Subject: | Bug #79827 [Com]: debug_backtrace() does not return passed args | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-227943@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79827&edit=1
ID: 79827
Comment by: michael dot vorisek at email dot cz
Reported by: michael dot vorisek at email dot cz
Summary: debug_backtrace() does not return passed args
Status: Duplicate
Type: Bug
Package: Scripting Engine problem
Operating System: any
PHP Version: 7.4.8
Block user comment: N
Private report: N
New Comment:
This actually violates the language definition, as
$filename = realpath($filename);
is not an assigment by reference!
Previous Comments:
------------------------------------------------------------------------
[2020-07-10 16:09:39] michael dot vorisek at email dot cz
Any functions that rely on backtrace are currently affected.
Is the penalty of copy on write really that high and is there a will to fix this issue?
------------------------------------------------------------------------
[2020-07-10 14:10:35] nikic@php.net
Duplicate of bug #71547.
------------------------------------------------------------------------
[2020-07-10 14:08:03] michael dot vorisek at email dot cz
Description:
------------
debug_backtrace() currently returns args by reference, ie. the returned args variables, not the
passed values.
Very hard to debug, backtrace should always return the passed data.
Test script:
---------------
function x(string $filename) {
$filename = realpath($filename);
$trace = debug_backtrace();
var_dump($trace[0]['args']);
}
x('non_existing_file.txt');
Expected result:
----------------
array(1) {
[0]=>
bool(false)
}
Actual result:
--------------
array(1) {
[0]=>
string(21) "non_existing_file.txt"
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79827&edit=1