3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<!DOCTYPE> <html> <body> <?php $from = 'jjacobs@valdosta.edu'; $subject=$_POST['subject']; $text=$_POST['libnews']; if ((empty($subject) &&empty($text)) echo 'You forgot the email subject and body text.<br/>'; } if ((empty($subject) && (!empty($text) echo 'You forgot the email subject.<br/>'; } if ((empty($subject)) && empty($text) { echo 'You forgot the email body text.<br/>': } if ((empty($subject)) && (!empty($text)) { $dbc=mysqli_conntect('localhost', 'root', 'root', 'astwo_jacobs') error or die ('Error connection to MySQL server.'); $query = "SELECT * FROM email_list"; $result = mysqli_query($dbc, $query) or die('Error querying database.'); while ($row = mysqli_fetch_array($resu{)) $to = $row['email']; $first_name = $row['first_name']; $last_name = $row['last_name']; $msg = "Dear $first_name $last_name,\n$text"; mail($to, $subject, $msg, 'From:' . $from); echo 'Email sent to: ' . $to . '<br />'; } mysqli_close($dbc); ?> <p><a href= "http://localhost/asthree_sendemail.html>Back to the form</a></p> </body> </html>
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.1.7
Parse error: syntax error, unexpected 'echo' (T_ECHO) in /in/h3H8p on line 11
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: syntax error, unexpected T_ECHO in /in/h3H8p:11 Stack trace: #0 {main}
Process exited with code 255.