Page MenuHomePhabricator
Paste P1142

Array merge
ActivePublic

Authored by sascha-egerer on May 15 2014, 7:55 PM.
Array 1:
array (
0 => 'foo',
)
Array 2:
array (
)
$array1 + $array2
array (
0 => 'foo',
)
array_merge($array1, $array2)
array (
0 => 'foo',
)
array_merge_recursive($array1, $array2)
array (
0 => 'foo',
)
array_merge_recursive_overrule($array1, $array2)
array (
0 => 'foo',
)
---------
Array 1:
array (
)
Array 2:
array (
0 => 'foo',
)
$array1 + $array2
array (
0 => 'foo',
)
array_merge($array1, $array2)
array (
0 => 'foo',
)
array_merge_recursive($array1, $array2)
array (
0 => 'foo',
)
array_merge_recursive_overrule($array1, $array2)
array (
0 => 'foo',
)
---------
Array 1:
array (
0 => 'bar',
)
Array 2:
array (
0 => 'foo',
)
$array1 + $array2
array (
0 => 'bar',
)
array_merge($array1, $array2)
array (
0 => 'bar',
1 => 'foo',
)
array_merge_recursive($array1, $array2)
array (
0 => 'bar',
1 => 'foo',
)
array_merge_recursive_overrule($array1, $array2)
array (
0 => 'foo',
)
---------
Array 1:
array (
'bar' => 1,
)
Array 2:
array (
'foo' => 2,
)
$array1 + $array2
array (
'bar' => 1,
'foo' => 2,
)
array_merge($array1, $array2)
array (
'bar' => 1,
'foo' => 2,
)
array_merge_recursive($array1, $array2)
array (
'bar' => 1,
'foo' => 2,
)
array_merge_recursive_overrule($array1, $array2)
array (
'bar' => 1,
'foo' => 2,
)
---------
Array 1:
array (
'bar' => 1,
)
Array 2:
array (
'bar' => 2,
)
$array1 + $array2
array (
'bar' => 1,
)
array_merge($array1, $array2)
array (
'bar' => 2,
)
array_merge_recursive($array1, $array2)
array (
'bar' =>
array (
0 => 1,
1 => 2,
),
)
array_merge_recursive_overrule($array1, $array2)
array (
'bar' => 2,
)
---------
Array 1:
array (
'bar' => 1,
'bar-1' => 'stringValue',
)
Array 2:
array (
'foo' => 2,
)
$array1 + $array2
array (
'bar' => 1,
'bar-1' => 'stringValue',
'foo' => 2,
)
array_merge($array1, $array2)
array (
'bar' => 1,
'bar-1' => 'stringValue',
'foo' => 2,
)
array_merge_recursive($array1, $array2)
array (
'bar' => 1,
'bar-1' => 'stringValue',
'foo' => 2,
)
array_merge_recursive_overrule($array1, $array2)
array (
'bar' => 1,
'bar-1' => 'stringValue',
'foo' => 2,
)
---------
Array 1:
array (
'bar' =>
array (
0 => 'foo',
),
)
Array 2:
array (
'bar' => 2,
)
$array1 + $array2
array (
'bar' =>
array (
0 => 'foo',
),
)
array_merge($array1, $array2)
array (
'bar' => 2,
)
array_merge_recursive($array1, $array2)
array (
'bar' =>
array (
0 => 'foo',
1 => 2,
),
)
array_merge_recursive_overrule($array1, $array2)
array (
'bar' => 2,
)
---------
Array 1:
array (
'bar' =>
array (
0 => 'foo',
),
)
Array 2:
array (
'bar' =>
array (
0 => 'bar',
),
)
$array1 + $array2
array (
'bar' =>
array (
0 => 'foo',
),
)
array_merge($array1, $array2)
array (
'bar' =>
array (
0 => 'bar',
),
)
array_merge_recursive($array1, $array2)
array (
'bar' =>
array (
0 => 'foo',
1 => 'bar',
),
)
array_merge_recursive_overrule($array1, $array2)
array (
'bar' =>
array (
0 => 'bar',
),
)
---------
Array 1:
array (
'bar' =>
array (
'bar' => 1,
'foo' => 1,
),
)
Array 2:
array (
'bar' =>
array (
'bar' => 2,
),
)
$array1 + $array2
array (
'bar' =>
array (
'bar' => 1,
'foo' => 1,
),
)
array_merge($array1, $array2)
array (
'bar' =>
array (
'bar' => 2,
),
)
array_merge_recursive($array1, $array2)
array (
'bar' =>
array (
'bar' =>
array (
0 => 1,
1 => 2,
),
'foo' => 1,
),
)
array_merge_recursive_overrule($array1, $array2)
array (
'bar' =>
array (
'bar' => 2,
'foo' => 1,
),
)

Event Timeline

sascha-egerer changed the title of this paste from untitled to Array merge.
sascha-egerer updated the paste's language from autodetect to php.