Bug #69821 [Opn->Nab]: Re-assigning argument affects func_get_args()
| From: | nikic@php.net | Date: | Sat, 13 Jun 2015 19:34:32 +0000 |
| Subject: | Bug #69821 [Opn->Nab]: Re-assigning argument affects func_get_args() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-193417@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=69821&edit=1
ID: 69821
Updated by: nikic@php.net
Reported by: lbarnaud@php.net
Summary: Re-assigning argument affects func_get_args()
-Status: Open
+Status: Not a bug
Type: Bug
Package: *General Issues
PHP Version: 7.0.0alpha1
Block user comment: N
Private report: N
New Comment:
This is an intentional BC break, please see https://github.com/php/php-src/blob/6084844fb5b93d3712d5b1376ed99bfa6c51b637/UPGRADING#L192.
Previous Comments:
------------------------------------------------------------------------
[2015-06-13 19:23:49] lbarnaud@php.net
Description:
------------
When re-assigning an argument in a function, func_get_args() doesn't return the original
argument values anymore.
I found this while using Doctrine 2.3: https://github.com/doctrine/doctrine2/blob/b5e19dca182ee4c21dd26d14b2d707cd4ad4e95e/lib/Doctrine/ORM/QueryBuilder.php#L849
.
Test script:
---------------
<?php
function test($a) {
$a = "overridden";
var_dump(func_get_args());
}
test("original");
Expected result:
----------------
array(1) {
[0]=>
string(8) "original"
}
Actual result:
--------------
array(1) {
[0]=>
string(10) "overridden"
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=69821&edit=1