3v4l.org

run code in 300+ PHP versions simultaneously
<?php // EDIT THE 2 LINES BELOW AS D $email_to = "abc18712@gmail.com"; $email_subject = "Hi from John 2"; $email_from = "Jon Lottern <john@rgwtgtwhgt.com>"; $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/'; function clean_string($string) { $bad = array("content-type","bcc:","to:","cc:","href"); return str_replace($bad,"",$string); } $email_message = "Hi there\n\n"; $email_message .= "Thought about this\n"; $email_message .= "Cheers\n"; // create email headers $headers = 'From: '.$email_from."\r\n". 'Reply-To: '.$email_from."\r\n" . 'X-Mailer: PHP/' . phpversion(); @mail($email_to, $email_subject, $email_message, $headers); print "sent";
Output for 8.0.0 - 8.0.3
Fatal error: Uncaught Error: Call to undefined function mail() in /in/HBuce:33 Stack trace: #0 {main} thrown in /in/HBuce on line 33
Process exited with code 255.
Output for 7.3.0 - 7.3.28, 7.4.0 - 7.4.16
sent