3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $state1 = "DL"; ?> <select class="dropdownState" name="<?php $i=1; echo 'state' . $i; ?>" id="<?php echo 'state' . $i; ?>"> <option value="DL" <?php if ($state{$i} == "DL") {echo ('selected="selected"');} ?>>DELETE</option> <option value="ZZ" <?php if ($state{$i} == "ZZ") {echo ('selected="selected"');} ?>>NONE</option>
Output for 5.0.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
<select class="dropdownState" name="state1" id="state1"> <option value="DL" Notice: Undefined variable: state in /in/DNsFc on line 3 >DELETE</option> <option value="ZZ" Notice: Undefined variable: state in /in/DNsFc on line 4 >NONE</option>
Output for 4.3.0 - 5.0.3
<select class="dropdownState" name="state1" id="state1"> <option value="DL" Notice: Undefined variable: state in /in/DNsFc on line 3 >DELETE</option> <option value="ZZ" Notice: Undefined variable: state in /in/DNsFc on line 4 >NONE</option>