3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = ['a' => ['1','2']]; $b = ['a' => ['3','4']]; var_dump(array_merge_recursive($a, $b)['a']); var_dump(($a + $b)['a']);
based on pj3Zt
Output for 7.0.0 - 7.2.0
array(4) { [0]=> string(1) "1" [1]=> string(1) "2" [2]=> string(1) "3" [3]=> string(1) "4" } array(2) { [0]=> string(1) "1" [1]=> string(1) "2" }
Output for 5.4.11 - 5.6.28
Parse error: syntax error, unexpected '[' in /in/j5l3d on line 8
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/j5l3d on line 3
Process exited with code 255.