|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-08-06 13:02 UTC] helly@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 07 23:00:01 2026 UTC |
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