note 111613 deleted from control-structures.foreach by aharvey

From: Date: Fri, 08 Mar 2013 18:28:32 +0000
Subject: note 111613 deleted from control-structures.foreach by aharvey
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-193998@lists.php.net to get a copy of this message
Note Submitter: mikael dot cordon at atos dot net ---- With version 5.3.6 you cannot write <?php foreach (isset ($e["messages"]) ? $e["messages"] : array () as & $m) { // some instructions } ?> or <?php foreach ((isset ($e["messages"]) ? $e["messages"] : array ()) as & $m) { // some instructions } ?> It reports a "syntax error, unexpected '&'". Instead, you can write <?php if (isset ($e["messages"])) { foreach ($e["messages"] as & $m) { // some instructions } } ?> A bug… ?

« previous php.notes (#193998) next »