3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php define('ANIMALS', [ 'dog', 'cat', 'bird' ]); echo ANIMALS[1]; // outputs "cat"
Output for 7.0.0 - 7.2.0
cat
Output for 5.6.8 - 5.6.28
Warning: Constants may only evaluate to scalar values in /in/8UtaA on line 6 Notice: Use of undefined constant ANIMALS - assumed 'ANIMALS' in /in/8UtaA on line 8 N
Output for 5.4.1 - 5.5.35
Parse error: syntax error, unexpected '[', expecting ',' or ';' in /in/8UtaA on line 8
Process exited with code 255.
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/8UtaA on line 2
Process exited with code 255.