note 108644 deleted from function.array-merge by salathe
| From: | salathe@php.net | Date: | Mon, 06 Sep 2021 22:45:20 +0000 |
| Subject: | note 108644 deleted from function.array-merge by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-216892@lists.php.net to get a copy of this message | ||
Note Submitter: Gemorroj
----
The function behaves differently with numbers more than PHP_INT_MAX
<?php
$arr1 = array('1234567898765432123456789' => 'dd');
$arr2 = array('123456789876543212345678' => 'ddd', '35' =>
'xxx');
var_dump(array_merge($arr1, $arr2));
//
$arr1 = array('1234' => 'dd');
$arr2 = array('12345' => 'ddd', '35' => 'xxx');
var_dump(array_merge($arr1, $arr2));
?>
result:
array(3) {
["1234567898765432123456789"]=>
string(2) "dd"
["123456789876543212345678"]=>
string(3) "ddd"
[0]=>
string(3) "xxx"
}
array(3) {
[0]=>
string(2) "dd"
[1]=>
string(3) "ddd"
[2]=>
string(3) "xxx"
}