3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $y = ['2014','2015','2016','2017','2018','2019','2020']; for($i = 0, $c = count($y); $i < $c; $i++) //var_dump($i,$y[$i]); echo $i,\n; echo $y[$i]; ?>
based on mIKBa
Output for 7.0.0 - 7.3.0rc4
0 Fatal error: Uncaught Error: Undefined constant 'n' in /in/8DIJp:13 Stack trace: #0 {main} thrown in /in/8DIJp on line 13
Process exited with code 255.
Output for 5.4.10 - 5.6.28
0 Fatal error: Undefined constant 'n' in /in/8DIJp on line 13
Process exited with code 255.
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/8DIJp on line 6
Process exited with code 255.