3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php define('TEST', ['one', 'two', 'three']); echo TEST['1'];
based on 3bpuD
Output for hhvm-3.19.2 - 3.22.0, 7.0.0 - 7.3.0
two
Output for 5.6.0 - 5.6.38, hhvm-3.15.4 - 3.18.5
Warning: Constants may only evaluate to scalar values in /in/nij9U on line 3 Notice: Use of undefined constant TEST - assumed 'TEST' in /in/nij9U on line 5 E
Output for hhvm-3.11.1 - 3.13.2
Fatal error: Uncaught Error: syntax error, unexpected '[', expecting ',' or ';' in /in/nij9U:5 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.10.1
Fatal error: syntax error, unexpected '[', expecting ',' or ';' in /in/nij9U on line 5
Process exited with code 255.
Output for 5.4.10 - 5.5.38
Parse error: syntax error, unexpected '[', expecting ',' or ';' in /in/nij9U on line 5
Process exited with code 255.
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/nij9U on line 3
Process exited with code 255.