3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function test(){ $z = 'something'; $x += array( 'first' => 'a', 'second' => 'y', 'thrid' => 'z' ); return $x; } $y = test(); echo $y['first'];
based on Ao1La
Output for 7.0.0 - 7.2.0
Notice: Undefined variable: x in /in/alEhc on line 6 Fatal error: Uncaught Error: Unsupported operand types in /in/alEhc:6 Stack trace: #0 /in/alEhc(12): test() #1 {main} thrown in /in/alEhc on line 6
Process exited with code 255.
Output for 5.3.22 - 5.6.28
Notice: Undefined variable: x in /in/alEhc on line 9 Fatal error: Unsupported operand types in /in/alEhc on line 9
Process exited with code 255.