3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php define('TEST', ['FOO' => 1, 'BAR' => 2, 'BAZ' => 3]); var_dump(TEST);
Output for 7.0.0 - 7.2.0
array(3) { ["FOO"]=> int(1) ["BAR"]=> int(2) ["BAZ"]=> int(3) }
Output for 5.4.12 - 5.6.28
Warning: Constants may only evaluate to scalar values in /in/Qj6ie on line 3 Notice: Use of undefined constant TEST - assumed 'TEST' in /in/Qj6ie on line 5 string(4) "TEST"
Output for 5.3.22 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/Qj6ie on line 3
Process exited with code 255.