Array concatenation behaviour change
| From: | rich gray | Date: | Fri, 08 Oct 2004 08:41:23 +0000 |
| Subject: | Array concatenation behaviour change | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-198936@lists.php.net to get a copy of this message | ||
Just a heads up on this change in array concatenation behaviour that
could cause a few probs for some people...
<?
$arr1 = array(0 => 'Zero');
$arr2 = array(1 => 'One',2 => 'Two');
$arr2 = $arr1 + $arr2;
echo phpversion().'<br />';
print_r($arr2);
?>
this code produces on our provider's server...
4.2.3
Array ( [0] => Zero [1] => One [2] => Two )
and on my development server...
4.3.8
Array ( [1] => One [2] => Two [0] => Zero )
hth
rich