note 98794 deleted from function.array-merge by danbrown
| From: | danbrown@php.net | Date: | Thu, 08 Jul 2010 14:11:59 +0000 |
| Subject: | note 98794 deleted from function.array-merge by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-170789@lists.php.net to get a copy of this message | ||
Note Submitter: Jase
----
jpakin at gmail dot com
In your example you implying a while would be faster. If your using PHP5, this is not the case. For
large memory arrays, it's MUCH faster and more efficient to use a reference in a foreach
<?php
$large_array = array(.......);
/* use reference when retrieving value */
foreach($large_array as $key => &$value){
$value is not a reference
}
unset($value); //unset this else an incorrect use of this variable later may cause undesired effects
?>