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 7.0.0 - 7.2.0
two
Output for 5.6.8 - 5.6.28
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 5.4.10 - 5.5.35
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.