3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php echo '<select id="etime" name="etime">'."\n"; for($i2 = 6; $i2 < 21; $i2++, $d2 = date("h A", strtotime($i2 . ":00:00"))) { $selected2 = ($i2 == 18) ? 'selected' : ''; echo '<option '.$selected2.' value="'.date("H:i:s", strtotime($i2 . ":00:00")) .'">'. $d2.'</option>'."\n"; } echo '</select>'."\n"; ?>
Output for 5.0.4 - 7.1.0
<select id="etime" name="etime"> Notice: Undefined variable: d2 in /in/vJuPv on line 5 <option value="06:00:00"></option> <option value="07:00:00">07 AM</option> <option value="08:00:00">08 AM</option> <option value="09:00:00">09 AM</option> <option value="10:00:00">10 AM</option> <option value="11:00:00">11 AM</option> <option value="12:00:00">12 PM</option> <option value="13:00:00">01 PM</option> <option value="14:00:00">02 PM</option> <option value="15:00:00">03 PM</option> <option value="16:00:00">04 PM</option> <option value="17:00:00">05 PM</option> <option selected value="18:00:00">06 PM</option> <option value="19:00:00">07 PM</option> <option value="20:00:00">08 PM</option> </select>
Output for 4.3.0 - 5.0.3
<select id="etime" name="etime"> Notice: Undefined variable: d2 in /in/vJuPv on line 5 <option value="06:00:00"></option> <option value="07:00:00">07 AM</option> <option value="08:00:00">08 AM</option> <option value="09:00:00">09 AM</option> <option value="10:00:00">10 AM</option> <option value="11:00:00">11 AM</option> <option value="12:00:00">12 PM</option> <option value="13:00:00">01 PM</option> <option value="14:00:00">02 PM</option> <option value="15:00:00">03 PM</option> <option value="16:00:00">04 PM</option> <option value="17:00:00">05 PM</option> <option selected value="18:00:00">06 PM</option> <option value="19:00:00">07 PM</option> <option value="20:00:00">08 PM</option> </select>