3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php if (isset($_POST['submitted'])) { if (empty($_POST['name'])) { echo "<br />"."You forgot to enter your name."; } else { $n = $_POST['name']; } if (empty($_POST['noMatrik'])) { echo "<br />"."You forgot to enter your No Matrik."; } else { $m = $_POST['noMatrik']; } $selected_radio = $_POST['prog']; $kursus = $_POST['kursus']; echo "Nama: ".$n; echo "<br />"."No Matrik: ".$m; echo "<br />"."Program: ".$selected_radio; if(isset($_POST['kursus'])) { foreach ($_POST['kursus'] as $subj) { echo "<br />"."Kursus yang didaftarkan ".$subj."<br />"; } } else { echo "You did not choose a kursus."; } } else{ ?> <html> <form action="try3.php" method="post"> <p>Name: <input type="text" name="name" /></p> <p>No Matrik: <input type="text" name="noMatrik" /> </p> <p>Program: </p> <p><input type="radio" name="prog" value="DDC" /> DDC</p> <p> <input type="radio" name="prog" value="DDZ"/> DDZ</p> <p>Kursus yang diambil:</p> <p><input name="kursus" type="checkbox" value=DDz 3123/> DDz 3123</p> <p><input name="kursus" type="checkbox" value="DDC 2123" /> DDC 2123</p> <p><input name="kursus" type="checkbox" value="DDC 3223" /> DDC 3223</p> <p><input name="submit" type="submit"value="Hantar"/> <input name="reset" type="reset" value="Batal"/> <input name="submitted" type="hidden" /></p> </form> </html> <?php } ?>
Output for 4.3.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
<html> <form action="try3.php" method="post"> <p>Name: <input type="text" name="name" /></p> <p>No Matrik: <input type="text" name="noMatrik" /> </p> <p>Program: </p> <p><input type="radio" name="prog" value="DDC" /> DDC</p> <p> <input type="radio" name="prog" value="DDZ"/> DDZ</p> <p>Kursus yang diambil:</p> <p><input name="kursus" type="checkbox" value=DDz 3123/> DDz 3123</p> <p><input name="kursus" type="checkbox" value="DDC 2123" /> DDC 2123</p> <p><input name="kursus" type="checkbox" value="DDC 3223" /> DDC 3223</p> <p><input name="submit" type="submit"value="Hantar"/> <input name="reset" type="reset" value="Batal"/> <input name="submitted" type="hidden" /></p> </form> </html>
Output for hhvm-3.10.0

Process exited with code 153.