3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php if ($stmt = $mysqli->prepare("INSERT INTO `regisrations`(`country`,`state`,`IP`,`email`,`firstname`,`lastname`,`othernames`,`pin`,`dayphone`,`postal`,`affiliation`) VALUES (?,?,?,?,?,?,?,?,?,?,?)")){ $stmt->bind_param('ssssssissss',$_SESSION[country],$_SESSION[state],$_SESSION[IP],$_SESSION[email],$_SESSION[firstname],$_SESSION[lastname],$_SESSION[othernames],$_SESSION[pin],$_SESSION[dayphone],$_SESSION[postal],$_SESSION[affiliation]); $_SESSION[country] = $_POST['country']; $_SESSION[state] = $_POST['state']; $_SESSION[IP] = $_POST['IP']; $_SESSION[email] = $_POST['email']; $_SESSION[firstname] = $_POST['firstname']; $_SESSION[lastname] = $_POST['lastname']; $_SESSION[othernames] = $_POST['othernames']; $_SESSION[pin] = $_POST['pin']; $_SESSION[dayphone] = $_POST['dayphone']; $_SESSION[postal] = $_POST['postal']; $_SESSION[affiliation] = $_POST['affiliation'];var_dump($result); $stmt->execute(); $stmt->close(); }else { printf("Prepared Statement Error: %s\n", $mysqli->error); } echo "<h1>Registration Complete!</h1>"; echo "<br />Thank you! You should receive an email shortly confirming your registration as shown below:"; $msg = "Thank you for registering. we are verifying your details and then create your account<br /><br />"; $msg .= "===================================================================<br />"; $msg .= "Contact Information:<br />"; $msg .= "===================================================================<br />"; $msg .= "Type: $_SESSION[country] <br />"; $msg .= "Organisation Name: $_SESSION[state] <br />"; $msg .= "Organisation Pin: $_SESSION[IP] <br />"; $msg .= "Email: $_SESSION[email] <br />"; $msg .= "Participant Name: $_SESSION[firstname] <br />"; $msg .= "Surname: $_SESSION[lastname] <br />"; $msg .= "Other Names: $_SESSION[othernames] <br />"; $msg .= "Participant PIN : $_SESSION[pin] <br />"; $msg .= "Phone: $_SESSION[dayphone] <br />"; $msg .= "Postal Address: $_SESSION[postal] <br />"; $msg .= "Designation: $_SESSION[affiliation] <br />"; $msg .= "Designation: $_SESSION[affiliation] <br />"; $msg .= "===================================================================<br />"; $msg .= "If you have any questions, contact us on Tel: 020 4965508 or Email: contactcentre@kentrade.go.ke<br />"; echo $msg; //Send confirmation message to user. $sender = "noreply@kentrade.go.ke"; $subject = "Registration Confirmed"; $mailheaders = "MIME-Version: 1.0\r\n"; $mailheaders .= "Content-type: text/html; charset=ISO-8859-1\r\n"; $mailheaders .= "From: $sender"; mail($_SESSION[email], $subject, $msg, $mailheaders); ?>
based on 2jn6i
Output for 7.0.5 - 7.1.0
Notice: Undefined variable: mysqli in /in/9parp on line 2 Fatal error: Uncaught Error: Call to a member function prepare() on null in /in/9parp:2 Stack trace: #0 {main} thrown in /in/9parp on line 2
Process exited with code 255.
Output for 7.0.0 - 7.0.4
Notice: Undefined variable: mysqli in /in/9parp on line 2 Fatal error: Uncaught Error: Call to a member function prepare() on unknown in /in/9parp:2 Stack trace: #0 {main} thrown in /in/9parp on line 2
Process exited with code 255.
Output for hhvm-3.12.0
Notice: Undefined variable: mysqli in /in/9parp on line 2 Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function prepare() on a non-object (null)' in /in/9parp:2 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.6.7 - 5.6.28
Notice: Undefined variable: mysqli in /in/9parp on line 2 Fatal error: Call to a member function prepare() on null in /in/9parp on line 2
Process exited with code 255.
Output for 5.0.4 - 5.5.35
Notice: Undefined variable: mysqli in /in/9parp on line 2 Fatal error: Call to a member function prepare() on a non-object in /in/9parp on line 2
Process exited with code 255.
Output for 5.0.0 - 5.0.3
Notice: Undefined variable: mysqli in /in/9parp on line 2 Fatal error: Call to a member function prepare() on a non-object in /in/9parp on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Call to a member function on a non-object in /in/9parp on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to a member function on a non-object in /in/9parp on line 2