3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = array("red", "blue"); for ($i=0; $i<2; $i++){ echo $array[i]; } echo $array[0];
Output for 7.2.0 - 7.3.1
Warning: Use of undefined constant i - assumed 'i' (this will throw an Error in a future version of PHP) in /in/ahLJc on line 4 Notice: Undefined index: i in /in/ahLJc on line 4 Warning: Use of undefined constant i - assumed 'i' (this will throw an Error in a future version of PHP) in /in/ahLJc on line 4 Notice: Undefined index: i in /in/ahLJc on line 4 red
Output for 5.3.0 - 7.1.25
Notice: Use of undefined constant i - assumed 'i' in /in/ahLJc on line 4 Notice: Undefined index: i in /in/ahLJc on line 4 Notice: Use of undefined constant i - assumed 'i' in /in/ahLJc on line 4 Notice: Undefined index: i in /in/ahLJc on line 4 red
Output for 4.3.0 - 5.2.17
Notice: Use of undefined constant i - assumed 'i' in /in/ahLJc on line 4 Notice: Undefined index: i in /in/ahLJc on line 4 Notice: Use of undefined constant i - assumed 'i' in /in/ahLJc on line 4 Notice: Undefined index: i in /in/ahLJc on line 4 red