3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = <<<DATA [ { "name": "counting animals", "template": "counting", "data": "Images/5cats.jpg", "choices": [ 2, 5, 6, 8 ], "correctAnswer": 1 } ] DATA; $json_var = json_decode($data, true); foreach ($json_var as $value) { if ($value["name"] === "counting animals") { printf('<img src="' . $value["data"] . '" />'); printf("<form id=\"form1\">"); foreach ($value["choices"] as $val) { printf("<input name=\"image-pick\" value=$val type=\"radio\" id=\"one-$val\" >" ); printf("<label></label>"); } printf("</form>"); } }
Output for git.master, git.master_jit, rfc.property-hooks
<img src="Images/5cats.jpg" /><form id="form1"><input name="image-pick" value=2 type="radio" id="one-2" ><label></label><input name="image-pick" value=5 type="radio" id="one-5" ><label></label><input name="image-pick" value=6 type="radio" id="one-6" ><label></label><input name="image-pick" value=8 type="radio" id="one-8" ><label></label></form>

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:
386.57 ms | 406 KiB | 5 Q