|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-07-26 21:26 UTC] cataphract@php.net
-Status: Open
+Status: Not a bug
[2012-07-26 21:26 UTC] cataphract@php.net
[2012-07-26 23:47 UTC] katelyn dot schiesser at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 14:00:01 2025 UTC |
Description: ------------ I apologize in advance if this has been reported elsewhere, I searched without finding anything. I have tested this on boxes running versions of PHP 5.3.13, and 5.3.3. [slowbro@node05 ~]$ php -v PHP 5.3.3 (cli) (built: Jul 3 2012 16:53:21) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies The issue is that I can't pass inline-set variables by reference. For example, this works: test($var='something'); ...but this doesn't: test(&$var='something'); Perhaps this is the way the engine works or something- but I would think it would be easy enough to (and make sense to) allow this. Test script: --------------- function test(&$var){ $var = 'something else'; } test(&$newvar='something'); echo $newvar; Expected result: ---------------- something else Actual result: -------------- PHP Parse error: syntax error, unexpected '=', expecting ')' in php shell code on line 1