3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $adult = 1; ?> <div> <label for="adult"><strong>File content:</strong></label> <select name="adult" id="adult" required> <option value="0"<?php echo ((!$adult) ? ' selected' : '')?>>Family friendly</option> <option value="1"<?php echo (($adult) ? ' selected' : '')?>>Adult</option> </select> </div>
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
<div> <label for="adult"><strong>File content:</strong></label> <select name="adult" id="adult" required> <option value="0">Family friendly</option> <option value="1" selected>Adult</option> </select> </div>