3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr = [(new stdClass), new stdClass, new stdClass]; $arr[0]=>text = "ans1"; $arr[1]=>text = "ans2"; $arr[2]=>text = "ans3"; $nu = [arr[0].text,arr[1].text,arr[2].text]; var_dump($nu);
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.1.7
Parse error: syntax error, unexpected '=>' (T_DOUBLE_ARROW) in /in/7OFVv on line 4
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: syntax error, unexpected T_DOUBLE_ARROW in /in/7OFVv:4 Stack trace: #0 {main}
Process exited with code 255.