3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php define("ANIMAL", array('cat' => 'meow')); echo ANIMAL['cat'];
based on kD7Xe
Output for 7.0.0 - 7.2.0
meow
Output for 5.6.8 - 5.6.28
Warning: Constants may only evaluate to scalar values in /in/AdXX2 on line 3 Notice: Use of undefined constant ANIMAL - assumed 'ANIMAL' in /in/AdXX2 on line 5 Warning: Illegal string offset 'cat' in /in/AdXX2 on line 5 A
Output for 5.3.21 - 5.5.35
Parse error: syntax error, unexpected '[', expecting ',' or ';' in /in/AdXX2 on line 5
Process exited with code 255.