3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $city = 'Charlotte'; echo [ 'Charlotte'=>183, 'Tampa'=>220, 'Pittsburgh'=>222, 'Los Angeles'=>475 ][$city] ?: 0; $city = 'Smallville'; @echo [ 'Charlotte'=>183, 'Tampa'=>220, 'Pittsburgh'=>222, 'Los Angeles'=>475 ][$city] ?: 0;
Output for 5.4.0 - 5.4.24
Parse error: syntax error, unexpected '[', expecting ',' or ';' in /in/jDF7j on line 9
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected '[' in /in/jDF7j on line 4
Process exited with code 255.