From: tomek at realtsp dot com Operating system: FreeBSD PHP version: 5.1.2 PHP Bug Type: Scripting Engine problem Bug description: ignoring passing expression by reference
Description: ------------ If we pass an expression by reference, it doesn't recognize the variable from the expression, but doesn't complain about that fact either. As written in http://www.php.net/manual/en/language.references.pass.php, such statement is invalid. Strangely enough it worked up to 5.0.4 (and 5.0.5 perhaps) and stopped working after upgrade to 5.1.2. Moreover, since both remaining examples from the documentation produce a fatal error, it would seem natural if that one would as well. Reproduce code: --------------- <?php function inc(&$a) { $a++; } // $b = 3; // inc($b); inc($b = 3); echo $b ."\n"; ?> Expected result: ---------------- Either 4 or a fatal error, rather than silently doing nothing. Actual result: -------------- 3 -- Edit bug report at http://bugs.php.net/?id=36654&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36654&r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36654&r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36654&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=36654&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=36654&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=36654&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=36654&r=needscript Try newer version: http://bugs.php.net/fix.php?id=36654&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=36654&r=support Expected behavior: http://bugs.php.net/fix.php?id=36654&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=36654&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=36654&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=36654&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36654&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=36654&r=dst IIS Stability: http://bugs.php.net/fix.php?id=36654&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=36654&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=36654&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=36654&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=36654&r=mysqlcfg
