3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function orders_insert(){ $recID=mysql_insert_id(); sql("insert into membership_userrecords set tableName='orders', pkValue='$recID', memberID='".getLoggedMemberID()."', dateAdded='".time()."', dateUpdated='".time()."', groupID='".getLoggedGroupID()."'", $eo); // our modified code for sending the email notification $userEmail=sqlValue("select email from membership_users where memberID='".getLoggedMemberID()."'"); mail( to, subject,message,header); /* comma-separated list of recipients */ $to = "Anil.Rawat@turner.com, Amit.Saxena@turner.com, Uday.Sativa@turner.com, $userEmail"; /* message subject */ $subject = "SDR update"; /* message contents */ $message = "SDR has been created/updated by ".getLoggedMemberID(); ".\n\n". /* we must add sender email similar to this */ $header = "From: michael.acheampong@turner.com"; return (get_magic_quotes_gpc() ? stripslashes($recID) : $recID); } if (mail($to,$subject,$body)){ echo ("<p>Email successfully sent!</p>"); } else{ echo("<p>Email delivery failed</p>"); } ?>
based on HmJMe
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.2.8
Notice: Undefined variable: to in /in/s9idv on line 28 Notice: Undefined variable: subject in /in/s9idv on line 28 Notice: Undefined variable: body in /in/s9idv on line 28 Warning: mail() has been disabled for security reasons in /in/s9idv on line 28 <p>Email delivery failed</p>
Output for hhvm-3.15.4
Notice: Undefined variable: to in /in/s9idv on line 28 Notice: Undefined variable: subject in /in/s9idv on line 28 Notice: Undefined variable: body in /in/s9idv on line 28 Warning: mail() expects parameter 1 to be string, null given in /in/s9idv on line 28 <p>Email delivery failed</p>