#38355 [NEW]: @ operator prevents 'Only variables can be passed by reference' error

From: Date: Sun, 06 Aug 2006 12:52:17 +0000
Subject: #38355 [NEW]: @ operator prevents 'Only variables can be passed by reference' error
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-100414@lists.php.net to get a copy of this message
From: dima at snaiper dot no-ip dot com Operating system: Windows XP PHP version: 5.1.4 PHP Bug Type: Scripting Engine problem Bug description: @ operator prevents 'Only variables can be passed by reference' error Description: ------------ @ in argument passed into function prevents 'Fatal error: Only variables can be passed by reference' error. Reproduce code: --------------- function test(& $a) { echo $a; } $b = "hello"; test($b); // hello test($b[0]); // 'Fatal error: Only variables can be passed by reference' test(@ $b[0]); // h Expected result: ---------------- 'Fatal error: Only variables can be passed by reference' Actual result: -------------- test(@ $b[0]); // h -- Edit bug report at http://bugs.php.net/?id=38355&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=38355&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=38355&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=38355&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=38355&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=38355&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=38355&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=38355&r=needscript Try newer version: http://bugs.php.net/fix.php?id=38355&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=38355&r=support Expected behavior: http://bugs.php.net/fix.php?id=38355&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=38355&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=38355&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=38355&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38355&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=38355&r=dst IIS Stability: http://bugs.php.net/fix.php?id=38355&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=38355&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=38355&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=38355&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=38355&r=mysqlcfg

« previous php.bugs (#100414) next »