Array concatenation behaviour change

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux