3v4l.org

run code in 300+ PHP versions simultaneously
<!DOCTYPE html> <html> <head> <title>E-permanence</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Cache-Control " content="no-cache"> <style> label { display:block; margin: 20px 0 5px 0; } </style> </head> <body> <h1>Inscription</h1> <form name="form" method="post" action="$$valeurs.php"> <label for="nom">Nom*</label> <input name="nom" type="text" id="nom" maxlength="20"> <label for="prenom">Prenom*</label> <input name="prenom" type="text" id="prenom" maxlength="20"> <label for="mail">Mail*</label> <input name="mail" type="email" id="mail" maxlength="20"> <label for="sexe">Votre sexe</label> <input name="sexe" type="text" id="sexe"> <label for="profession">Votre profession</label> <input name="profession" type="text" id="profession"> <p><input type="submit" value="go"></p> </form> </body> </html> <?php // si qqch est posté ($_POST = tableau) if(isset($_POST)) { // pour chaque valeur du tableau foreach ($_POST as $key => $post) { // transforme la clé (form name) en variable et attribue lui sa valeur correspondante ${$key} = strip_tags(trim($post)); } } /* $nom = ''; $prenom = ''; $mail = ''; $sexe = ''; $profession = ''; */ $tab = array('nom', 'prenom', 'mail', 'sexe', 'profession'); foreach($tab as $value) { if (!isset(${$value})) { ${$value} = ''; // die(var_dump($value)); } } if(empty($nom) || empty($prenom) || empty($mail)) { ?> <html> <head> <title>Avertissement</title> </head> <body> <?php // header("Location:e-perm_homepprofession.php?inscription=no&prob=1"); ?> <h1>Erreur</h1> <p style="font-weight:bold; color:#990000;">Veuillez remplir tous les champs requis</p> <p><a href="e-perm_register.php">Retour</a></p> </body> </html> <?php } else { var_dump($nom); var_dump($prenom); var_dump($mail); var_dump($sexe); var_dump($profession); } ?>
Output for git.master, git.master_jit, rfc.property-hooks
<!DOCTYPE html> <html> <head> <title>E-permanence</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Cache-Control " content="no-cache"> <style> label { display:block; margin: 20px 0 5px 0; } </style> </head> <body> <h1>Inscription</h1> <form name="form" method="post" action="$$valeurs.php"> <label for="nom">Nom*</label> <input name="nom" type="text" id="nom" maxlength="20"> <label for="prenom">Prenom*</label> <input name="prenom" type="text" id="prenom" maxlength="20"> <label for="mail">Mail*</label> <input name="mail" type="email" id="mail" maxlength="20"> <label for="sexe">Votre sexe</label> <input name="sexe" type="text" id="sexe"> <label for="profession">Votre profession</label> <input name="profession" type="text" id="profession"> <p><input type="submit" value="go"></p> </form> </body> </html> <html> <head> <title>Avertissement</title> </head> <body> <h1>Erreur</h1> <p style="font-weight:bold; color:#990000;">Veuillez remplir tous les champs requis</p> <p><a href="e-perm_register.php">Retour</a></p> </body> </html>

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:
29.33 ms | 409 KiB | 5 Q