3v4l.org

run code in 300+ PHP versions simultaneously
<?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_in = 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_in; } private function verify_password_and_login() { } 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(); ?>

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.4.260.0100.07719.06
5.4.250.0070.06718.75
5.4.240.0200.07018.99
5.4.230.0130.07018.67
5.4.220.0100.05718.91
5.4.210.0070.06018.92
5.4.200.0070.05718.91
5.4.190.0130.07318.93
5.4.180.0130.04718.88
5.4.170.0000.06318.73
5.4.160.0130.05718.82
5.4.150.0100.06018.97
5.4.140.0130.05316.60
5.4.130.0070.07716.47
5.4.120.0130.04716.39
5.4.110.0130.05316.46
5.4.100.0130.04716.59
5.4.90.0200.06316.54
5.4.80.0130.06716.33
5.4.70.0130.06316.39
5.4.60.0030.05716.34
5.4.50.0130.07016.54
5.4.40.0130.06716.47
5.4.30.0100.05316.40
5.4.20.0170.05016.39
5.4.10.0130.06316.42
5.4.00.0100.05315.92
5.3.280.0100.06014.44
5.3.270.0100.05314.62
5.3.260.0130.05314.59
5.3.250.0100.07714.61
5.3.240.0130.06014.68
5.3.230.0130.05314.54
5.3.220.0100.05714.74
5.3.210.0130.04714.76
5.3.200.0170.04014.76
5.3.190.0100.05014.49
5.3.180.0100.06314.76
5.3.170.0130.05014.65
5.3.160.0200.05714.59
5.3.150.0030.07714.71
5.3.140.0130.06014.66
5.3.130.0170.05014.74
5.3.120.0130.06314.65
5.3.110.0070.05714.73
5.3.100.0130.07014.01
5.3.90.0100.07314.13
5.3.80.0100.04713.93
5.3.70.0200.04013.94
5.3.60.0130.04314.07
5.3.50.0070.07014.05
5.3.40.0200.03714.04
5.3.30.0070.04713.99
5.3.20.0100.06713.87
5.3.10.0070.05313.64
5.3.00.0200.06013.64

preferences:
140.64 ms | 1394 KiB | 7 Q