#37351 [NEW]: func_get_args() does not return variables by reference

From: Date: Sun, 07 May 2006 18:49:53 +0000
Subject: #37351 [NEW]: func_get_args() does not return variables by reference
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-96775@lists.php.net to get a copy of this message
From: chris at starglade dot org Operating system: Any PHP version: 5.1.4 PHP Bug Type: Feature/Change Request Bug description: func_get_args() does not return variables by reference Description: ------------ func_get_args() and func_get_arg() should return variables by reference. Reproduce code: --------------- <?php $one = 'one'; $two = 'two'; $three = 'three'; function change_one_into_two_normal(&$var) { $var = 'two'; } function change_one_into_two_using_get_args() { $args = func_get_args(); $args[0] = 'two'; } change_one_into_two_normal($one); echo $one; $one = 'one'; change_one_into_two_using_get_args($one); echo $one; Expected result: ---------------- two one Actual result: -------------- two two -- Edit bug report at http://bugs.php.net/?id=37351&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37351&r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=37351&r=trysnapshot51 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=37351&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37351&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=37351&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=37351&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=37351&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=37351&r=needscript Try newer version: http://bugs.php.net/fix.php?id=37351&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=37351&r=support Expected behavior: http://bugs.php.net/fix.php?id=37351&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=37351&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=37351&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=37351&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37351&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=37351&r=dst IIS Stability: http://bugs.php.net/fix.php?id=37351&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=37351&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=37351&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=37351&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=37351&r=mysqlcfg

« previous php.bugs (#96775) next »