3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = []; $a[int] = 'abc'; print_r($a); echo($a[int]);
based on mBj8n
Output for 7.2.0
Warning: Use of undefined constant int - assumed 'int' (this will throw an Error in a future version of PHP) in /in/G7Ykn on line 4 Array ( [int] => abc ) Warning: Use of undefined constant int - assumed 'int' (this will throw an Error in a future version of PHP) in /in/G7Ykn on line 6 abc
Output for 5.4.8 - 7.1.10
Notice: Use of undefined constant int - assumed 'int' in /in/G7Ykn on line 4 Array ( [int] => abc ) Notice: Use of undefined constant int - assumed 'int' in /in/G7Ykn on line 6 abc
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/G7Ykn on line 3
Process exited with code 255.