3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a =[]; $f = a[1]; if($f == true){ echo "hi"; }
Output for 7.2.0
Warning: Use of undefined constant a - assumed 'a' (this will throw an Error in a future version of PHP) in /in/v0dXd on line 4 Notice: Uninitialized string offset: 1 in /in/v0dXd on line 4
Output for 5.6.8 - 7.1.10
Notice: Use of undefined constant a - assumed 'a' in /in/v0dXd on line 4 Notice: Uninitialized string offset: 1 in /in/v0dXd on line 4
Output for 5.4.10 - 5.5.35
Parse error: syntax error, unexpected '[' in /in/v0dXd on line 4
Process exited with code 255.
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/v0dXd on line 3
Process exited with code 255.