3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $res1 = array( array('a'=>'aa','b'=>'bb'), array('a'=>'aaa','b'=>'bbb') ); $res2 = array( array('a'=>'a','b'=>'b') ); var_dump($res2); $res += array( array('a'=>'aa','b'=>'bb') );
Output for 7.0.0 - 7.1.0
array(1) { [0]=> array(2) { ["a"]=> string(1) "a" ["b"]=> string(1) "b" } } Notice: Undefined variable: res in /in/n6BK8 on line 16 Fatal error: Uncaught Error: Unsupported operand types in /in/n6BK8:16 Stack trace: #0 {main} thrown in /in/n6BK8 on line 16
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
array(1) { [0]=> array(2) { ["a"]=> string(1) "a" ["b"]=> string(1) "b" } } Fatal error: Invalid operand type was used: cannot perform this operation with arrays in /in/n6BK8 on line 16
Process exited with code 255.
Output for 5.1.0 - 5.6.28
array(1) { [0]=> array(2) { ["a"]=> string(1) "a" ["b"]=> string(1) "b" } } Notice: Undefined variable: res in /in/n6BK8 on line 16 Fatal error: Unsupported operand types in /in/n6BK8 on line 16
Process exited with code 255.
Output for 5.0.4 - 5.0.5
array(1) { [0]=> array(2) { ["a"]=> string(1) "a" ["b"]=> string(1) "b" } } Notice: Undefined variable: res in /in/n6BK8 on line 14 Fatal error: Unsupported operand types in /in/n6BK8 on line 16
Process exited with code 255.
Output for 4.3.2 - 5.0.3
array(1) { [0]=> array(2) { ["a"]=> string(1) "a" ["b"]=> string(1) "b" } } Notice: Undefined variable: res in /in/n6BK8 on line 14 Fatal error: Unsupported operand types in /in/n6BK8 on line 16
Process exited with code 255.
Output for 4.3.0 - 4.3.1
array(1) { [0]=> array(2) { ["a"]=> string(1) "a" ["b"]=> string(1) "b" } } Notice: Undefined variable: res in /in/n6BK8 on line 14 Fatal error: Unsupported operand types in /in/n6BK8 on line 16