3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getgeneralSpecifications() { return [ ['sp_id' => 1, 'specifications_name' => 'example 1'], ['sp_id' => 2, 'specifications_name' => 'example 2'], ['sp_id' => 3, 'specifications_name' => 'example 3'], ['sp_id' => 4, 'specifications_name' => 'example 4'], ['sp_id' => 5, 'specifications_name' => 'example 5'], ['sp_id' => 6, 'specifications_name' => 'example 6'], ]; } $checked = explode(',', '1,2,4'); echo "<ul>"; foreach (getgeneralSpecifications() as $row) { printf( '<li> <label>%s</label> <div class="form-check"> <input class="form-check-input custom-checkbox generalsinglecheck" type="checkbox" value="%d" name="general_specification[]" %s> </div> </li>', $row['specifications_name'], $row['sp_id'], in_array($row['sp_id'], $checked) ? 'checked' : '' ); } echo "</ul>";
Output for git.master, git.master_jit, rfc.property-hooks
<ul><li> <label>example 1</label> <div class="form-check"> <input class="form-check-input custom-checkbox generalsinglecheck" type="checkbox" value="1" name="general_specification[]" checked> </div> </li><li> <label>example 2</label> <div class="form-check"> <input class="form-check-input custom-checkbox generalsinglecheck" type="checkbox" value="2" name="general_specification[]" checked> </div> </li><li> <label>example 3</label> <div class="form-check"> <input class="form-check-input custom-checkbox generalsinglecheck" type="checkbox" value="3" name="general_specification[]" > </div> </li><li> <label>example 4</label> <div class="form-check"> <input class="form-check-input custom-checkbox generalsinglecheck" type="checkbox" value="4" name="general_specification[]" checked> </div> </li><li> <label>example 5</label> <div class="form-check"> <input class="form-check-input custom-checkbox generalsinglecheck" type="checkbox" value="5" name="general_specification[]" > </div> </li><li> <label>example 6</label> <div class="form-check"> <input class="form-check-input custom-checkbox generalsinglecheck" type="checkbox" value="6" name="general_specification[]" > </div> </li></ul>

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
27.21 ms | 415 KiB | 5 Q