<?php
$first = [
'one' => 'first',
'two' => 'first',
'three' => 'first'
];
$second = [
'one' => 'second',
'two' => 'second',
'four' => 'second'
];
$third = [1,2,3,4];
$fourth = [5,6,7,8];
var_dump($first + $second);
var_dump($second + $first);
var_dump($third + $fourth);
array(4) {
["one"]=>
string(5) "first"
["two"]=>
string(5) "first"
["three"]=>
string(5) "first"
["four"]=>
string(6) "second"
}
array(4) {
["one"]=>
string(6) "second"
["two"]=>
string(6) "second"
["four"]=>
string(6) "second"
["three"]=>
string(5) "first"
}
array(4) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
[3]=>
int(4)
}