3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php error_reporting(E_ALL); ini_set('display_errors', 'On'); Class login { //protected $mod_id; //protected $mod_name; //protected $mod_password; //protected $mod_type; private $logged_status = false; //private $con = $this->db_connect(); public $status_message = ""; function __construct() { $this->runApplication(); //$this->mod_id = null; //$this->mod_name = null; //$this->mod_password = null; //$this->mod_type = null; } private function validate_inputs() { if (!empty($_POST['user_name']) && !empty($_POST['user_password'])) { return true; } elseif (empty($_POST['user_name'])) { $this->status_message = "Username field was empty."; } elseif (empty($_POST['user_password'])) { $this->status_message = "Password field was empty."; } // default return return false; } private function page_login_form() { if ($this->status_message) { echo $this->status_message . "<br/><br/>"; } echo '<h2>Login</h2>'; echo '<form method="post" action="' . $_SERVER['SCRIPT_NAME'] . '" name="loginform">'; echo '<label for="login_input_username">Username</label> '; echo '<input id="login_input_username" type="text" name="user_name" required /> '; echo '<label for="login_input_password">Password</label> '; echo '<input id="login_input_password" type="password" name="user_password" required /> '; echo '<input type="submit" name="login" value="Log in" />'; echo '</form>'; } public function get_login_status() { return $this->logged_status; } private function verify_password_and_login() { return true; } public funtion runApplication() { //session_start(); this->page_login_form(); } private function logout() { $_SESSION = array(); //session_destroy(); $this->logged_in = false; $this->status_message= "You were just logged out."; } } $application = new login(); ?>
Output for 5.4.0 - 5.4.26
Parse error: syntax error, unexpected 'funtion' (T_STRING), expecting variable (T_VARIABLE) in /in/JsvS9 on line 59
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in /in/JsvS9 on line 59
Process exited with code 255.