3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = array( "NJ", "NY", "PA" ); $length = count($array); echo "<select>"; for ($num = 0; $num <= $length; $num++) { echo "<option value='$num'> $array[$num] </option>"; } echo "</select>"; ?>
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
<select><option value='0'> NJ </option><option value='1'> NY </option><option value='2'> PA </option> Notice: Undefined offset: 3 in /in/dgaMT on line 15 <option value='3'> </option></select>
Output for hhvm-3.12.0
<select><option value='0'> NJ </option><option value='1'> NY </option><option value='2'> PA </option> Notice: Undefined index: 3 in /in/dgaMT on line -1 <option value='3'> </option></select>
Output for hhvm-3.10.0
<select><option value='0'> NJ </option><option value='1'> NY </option><option value='2'> PA </option> Notice: Undefined index: 3 in /in/dgaMT on line 15 <option value='3'> </option></select>
Output for 4.3.0 - 5.2.17
<select><option value='0'> NJ </option><option value='1'> NY </option><option value='2'> PA </option> Notice: Undefined offset: 3 in /in/dgaMT on line 15 <option value='3'> </option></select>