3v4l.org

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