note 111703 deleted from control-structures.foreach by aharvey
| From: | aharvey@php.net | Date: | Mon, 18 Mar 2013 20:56:35 +0000 |
| Subject: | note 111703 deleted from control-structures.foreach by aharvey | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-194118@lists.php.net to get a copy of this message | ||
Note Submitter: admin at phpse dot net
----
You may have trouble passing variable by reference, it is always good to be careful.
<?php
$a = array('zero', 'one', 'two');
foreach ($a as &$v) {}
foreach ($a as $v) {}
print_r($a);
//Array ( [0] => zero [1] => one [2] => one )