3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $to = $_REQUEST['sendto'] ; $from = $_REQUEST['email'] ; $name = $_REQUEST['nom'] ; $headers = "From: $from"; $subject = "[Site]"; $fields = array(); $fields{"nom"} = "Nom"; $fields{"email"} = "Email"; $fields{"telephone"} = "T&eacute;l&eacute;phone"; $fields{"message"} = "Message"; $body = "Message provenant du formulaire de contact du site web :\n\n"; foreach($fields as $a => $b) { $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); } $headers2 = "From: $from"; $subject2 = "Merci pour votre message."; $autoreply = "Merci pour votre message. Il sera lu attentivement dès que possible."; if($name == '') { print "Vous devez pr&eacute;ciser votre nom."; } else { if($from == '') { print "Vous devez entrer votre adresse mail."; } else { $send = mail($to, $subject, $body, $headers); $send2 = mail($from, $subject2, $autoreply, $headers2); if($send) { print "Succès."; } else { print "Une erreur a eu lieu lors de l'envoi du message... Veuillez en informer l'administrateur."; print "<p>"; print $subject; print "<p>"; print $body; } } } ?>
Output for 5.3.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
Notice: Undefined index: sendto in /in/aRDZL on line 2 Notice: Undefined index: email in /in/aRDZL on line 3 Notice: Undefined index: nom in /in/aRDZL on line 4 Notice: Undefined index: nom in /in/aRDZL on line 17 Notice: Undefined index: email in /in/aRDZL on line 17 Notice: Undefined index: telephone in /in/aRDZL on line 17 Notice: Undefined index: message in /in/aRDZL on line 17 Vous devez pr&eacute;ciser votre nom.
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.3.0 - 5.2.17
Notice: Undefined index: sendto in /in/aRDZL on line 2 Notice: Undefined index: email in /in/aRDZL on line 3 Notice: Undefined index: nom in /in/aRDZL on line 4 Notice: Undefined index: nom in /in/aRDZL on line 17 Notice: Undefined index: email in /in/aRDZL on line 17 Notice: Undefined index: telephone in /in/aRDZL on line 17 Notice: Undefined index: message in /in/aRDZL on line 17 Vous devez pr&eacute;ciser votre nom.