3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php error_reporting(E_ALL); // Simple array: $array = array(1, 2); $count = count($array); for ($i = 0; $i < $count; $i++) { echo "\nChecking $i: \n"; echo "Bad: " . $array['$i'] . "\n"; echo "Good: " . $array[$i] . "\n"; echo "Bad: {$array['$i']}\n"; echo "Good: {$array[$i]}\n"; }
Output for 5.3.28 - 5.3.29, 5.4.18 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
Checking 0: Notice: Undefined index: $i in /in/DHI2Q on line 8 Bad: Good: 1 Notice: Undefined index: $i in /in/DHI2Q on line 10 Bad: Good: 1 Checking 1: Notice: Undefined index: $i in /in/DHI2Q on line 8 Bad: Good: 2 Notice: Undefined index: $i in /in/DHI2Q on line 10 Bad: Good: 2
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.3.0 - 5.3.27, 5.4.0 - 5.4.17
Checking 0: Notice: Undefined index: $i in /in/BL5ME on line 8 Bad: Good: 1 Notice: Undefined index: $i in /in/BL5ME on line 10 Bad: Good: 1 Checking 1: Notice: Undefined index: $i in /in/BL5ME on line 8 Bad: Good: 2 Notice: Undefined index: $i in /in/BL5ME on line 10 Bad: Good: 2
Output for 4.3.1 - 5.2.17
Checking 0: Notice: Undefined index: $i in /in/BL5ME on line 8 Bad: Good: 1 Notice: Undefined index: $i in /in/BL5ME on line 10 Bad: Good: 1 Checking 1: Notice: Undefined index: $i in /in/BL5ME on line 8 Bad: Good: 2 Notice: Undefined index: $i in /in/BL5ME on line 10 Bad: Good: 2
Output for 4.3.0
Checking 0: Notice: Undefined index: $i in /in/DHI2Q on line 8 Bad: Good: 1 Notice: Undefined index: $i in /in/DHI2Q on line 10 Bad: Good: 1 Checking 1: Notice: Undefined index: $i in /in/DHI2Q on line 8 Bad: Good: 2 Notice: Undefined index: $i in /in/DHI2Q on line 10 Bad: Good: 2