3v4l.org

run code in 300+ PHP versions simultaneously
<?php const "FRUIT" = ['apple','pear','peach']; define('ANIMALS', [ 'dog', 'cat', 'bird' ]); echo ANIMALS[1]; // outputs "cat" echo FRUIT[1]; // outputs "pear" ?>
Output for 5.4.2 - 5.4.45, 5.5.24 - 5.5.30, 5.6.8 - 5.6.14
Parse error: syntax error, unexpected '"FRUIT"' (T_CONSTANT_ENCAPSED_STRING), expecting identifier (T_STRING) in /in/LLLK8 on line 3
Process exited with code 255.

preferences:
189.67 ms | 1395 KiB | 64 Q