note 108644 added to function.array-merge
| From: | Gemorroj | Date: | Mon, 14 May 2012 08:37:04 +0000 |
| Subject: | note 108644 added to function.array-merge | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-187966@lists.php.net to get a copy of this message | ||
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"
}
----
Server IP: 180.92.182.149
Probable Submitter: 86.57.144.21
----
Manual Page -- http://www.php.net/manual/en/function.array-merge.php
Edit -- https://master.php.net/note/edit/108644
Del: integrated -- https://master.php.net/note/delete/108644/integrated
Del: useless -- https://master.php.net/note/delete/108644/useless
Del: bad code -- https://master.php.net/note/delete/108644/bad+code
Del: spam -- https://master.php.net/note/delete/108644/spam
Del: non-english -- https://master.php.net/note/delete/108644/non-english
Del: in docs -- https://master.php.net/note/delete/108644/in+docs
Del: other reasons-- https://master.php.net/note/delete/108644
Reject -- https://master.php.net/note/reject/108644
Search -- https://master.php.net/manage/user-notes.php