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 4.3.0 - 7.1.0
<select class="dropdownState" name="state1" id="state1"> <option value="DL" selected="selected">DELETE</option> <option value="ZZ" >NONE</option>