note 68275 deleted from function.array-merge by cmb
| From: | cmb@php.net | Date: | Sun, 29 Sep 2019 07:31:13 +0000 |
| Subject: | note 68275 deleted from function.array-merge by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-212398@lists.php.net to get a copy of this message | ||
Note Submitter: anonyme
----
I don't think that the comment on + operator for array in array_merge page, was understandable,
this is just a little test to know exactly what's happend.
<?php
//test code for (array)+(array) operator
$a1 = array( '10', '11' , '12' , 'a' => '1a',
'b' => '1b');
$a2 = array( '20', '21' , '22' , 'a' => '2a',
'c' => '2c');
$a = $a1 + $a2;
print_r( $a );
//result: Array ( [0] => 10
// [1] => 11
// [2] => 12
// [a] => 1a
// [b] => 1b
// [c] => 2c )
$a = $a2 + $a1;
print_r( $a );
//result: Array ( [0] => 20
// [1] => 21
// [2] => 22
// [a] => 2a
// [c] => 2c
// [b] => 1b )
?>