Bug #69821 [NEW]: Re-assigning argument affects func_get_args()

From: Date: Sat, 13 Jun 2015 19:23:49 +0000
Subject: Bug #69821 [NEW]: Re-assigning argument affects func_get_args()
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-193416@lists.php.net to get a copy of this message
From: lbarnaud@php.net Operating system: PHP version: 7.0.0alpha1 Package: *General Issues Bug Type: Bug Bug description:Re-assigning argument affects func_get_args() 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 bug report at https://bugs.php.net/bug.php?id=69821&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69821&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69821&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69821&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=69821&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=69821&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=69821&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=69821&r=needscript Try newer version: https://bugs.php.net/fix.php?id=69821&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=69821&r=support Expected behavior: https://bugs.php.net/fix.php?id=69821&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=69821&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=69821&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=69821&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69821&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=69821&r=dst IIS Stability: https://bugs.php.net/fix.php?id=69821&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=69821&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=69821&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=69821&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=69821&r=mysqlcfg

« previous php.bugs (#193416) next »