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_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 function 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)
8.3.60.0160.00318.43
8.3.50.0080.01221.09
8.3.40.0110.01118.73
8.3.30.0090.00919.17
8.3.20.0110.00420.29
8.3.10.0040.00422.04
8.3.00.0080.00020.71
8.2.180.0150.00016.63
8.2.170.0140.00322.96
8.2.160.0100.00319.36
8.2.150.0060.00324.18
8.2.140.0050.00324.66
8.2.130.0070.00026.16
8.2.120.0050.00319.13
8.2.110.0030.00620.25
8.2.100.0060.00617.83
8.2.90.0030.00519.22
8.2.80.0000.00918.03
8.2.70.0000.00917.49
8.2.60.0040.00417.93
8.2.50.0030.00518.07
8.2.40.0030.00718.41
8.2.30.0040.00418.21
8.2.20.0040.00417.86
8.2.10.0040.00417.84
8.2.00.0030.00617.84
8.1.280.0100.00325.92
8.1.270.0040.00422.14
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00323.90
8.1.230.0060.00522.15
8.1.220.0080.00017.79
8.1.210.0090.00018.77
8.1.200.0000.00917.35
8.1.190.0040.00417.43
8.1.180.0060.00318.73
8.1.170.0040.00418.53
8.1.160.0070.00022.22
8.1.150.0060.00318.68
8.1.140.0030.00617.46
8.1.130.0040.00417.84
8.1.120.0030.00417.54
8.1.110.0050.00317.49
8.1.100.0070.00017.42
8.1.90.0000.00717.45
8.1.80.0040.00417.43
8.1.70.0040.00417.46
8.1.60.0090.00017.69
8.1.50.0040.00417.57
8.1.40.0040.00417.45
8.1.30.0040.00417.53
8.1.20.0000.00917.59
8.1.10.0000.00717.58
8.1.00.0030.00617.61
8.0.300.0050.00218.77
8.0.290.0030.00317.29
8.0.280.0030.00318.46
8.0.270.0040.00417.29
8.0.260.0070.00016.93
8.0.250.0030.00316.83
8.0.240.0000.00717.03
8.0.230.0000.00717.05
8.0.220.0030.00316.92
8.0.210.0050.00316.98
8.0.200.0070.00017.07
8.0.190.0070.00017.00
8.0.180.0070.00016.99
8.0.170.0000.00716.92
8.0.160.0040.00416.88
8.0.150.0040.00416.78
8.0.140.0070.00016.90
8.0.130.0000.00613.23
8.0.120.0090.00016.77
8.0.110.0040.00417.00
8.0.100.0080.00016.95
8.0.90.0090.00016.75
8.0.80.0030.01216.89
8.0.70.0060.00316.92
8.0.60.0030.00516.80
8.0.50.0040.00416.91
8.0.30.0110.00916.95
8.0.20.0080.01117.40
8.0.10.0000.00817.08
8.0.00.0110.00616.81
7.4.330.0050.00015.00
7.4.320.0030.00316.55
7.4.300.0030.00316.68
7.4.290.0030.00316.64
7.4.280.0070.00016.62
7.4.270.0000.00616.61
7.4.260.0000.00716.52
7.4.250.0040.00416.53
7.4.240.0030.00416.54
7.4.230.0000.00716.55
7.4.220.0060.01116.51
7.4.210.0110.00516.63
7.4.200.0000.00716.39
7.4.190.0070.00016.79
7.4.160.0040.01316.41
7.4.150.0080.00817.40
7.4.140.0100.00717.86
7.4.130.0100.01316.60
7.4.120.0180.00216.64
7.4.110.0100.00716.65
7.4.100.0030.01516.67
7.4.90.0160.00416.58
7.4.80.0110.00619.39
7.4.70.0090.00916.46
7.4.60.0060.00916.71
7.4.50.0000.00816.56
7.4.40.0030.01422.77
7.4.30.0060.01116.63
7.4.00.0030.01314.87
7.3.330.0050.00013.21
7.3.320.0000.00513.34
7.3.310.0000.00716.45
7.3.300.0070.00016.28
7.3.290.0100.00716.41
7.3.280.0060.01116.38
7.3.270.0040.01317.40
7.3.260.0090.00916.32
7.3.250.0090.00816.40
7.3.240.0150.00816.43
7.3.230.0090.00916.39
7.3.210.0110.00816.40
7.3.200.0130.00616.52
7.3.190.0090.00916.69
7.3.180.0060.01616.63
7.3.170.0040.01216.34
7.3.160.0150.00916.47
7.3.120.0060.00914.87
7.3.10.0080.00616.65
7.3.00.0050.00816.38
7.2.330.0190.00016.58
7.2.320.0110.00716.81
7.2.310.0000.01616.40
7.2.300.0100.00716.53
7.2.290.0060.01016.79
7.2.130.0060.00816.97
7.2.120.0060.00516.96
7.2.110.0040.01217.07
7.2.100.0070.00716.83
7.2.90.0060.00617.02
7.2.80.0020.01317.03
7.2.70.0060.00616.87
7.2.60.0030.01116.84
7.2.50.0070.00616.85
7.2.40.0050.00816.84
7.2.30.0050.01016.80
7.2.20.0060.00816.96
7.2.10.0090.00316.89
7.2.00.0070.00617.74
7.1.250.0090.00315.62
7.1.100.0000.00818.01
7.1.70.0030.00517.28
7.1.60.0100.01619.82
7.1.50.0060.01316.93
7.1.00.0030.07022.48
7.0.200.0030.00716.70
7.0.140.0030.06722.15
7.0.60.0200.06719.89
7.0.50.0070.05717.88
7.0.40.0070.04320.13
7.0.30.0300.06320.33
7.0.20.0330.08320.24
7.0.10.0100.09020.34
7.0.00.0100.04720.05
5.6.280.0070.07021.06
5.6.210.0130.07320.59
5.6.200.0000.08018.29
5.6.190.0070.08020.61
5.6.180.0230.04320.42
5.6.170.0300.04320.50
5.6.160.0100.08720.52
5.6.150.0070.03718.19
5.6.140.0100.08318.27
5.6.130.0000.04318.12
5.6.120.0200.06021.05
5.6.110.0100.06021.05
5.6.100.0070.08321.09
5.6.90.0030.09021.11
5.6.80.0130.04320.52
5.5.350.0070.07320.47
5.5.340.0100.04318.00
5.5.330.0100.05720.29
5.5.320.0170.04020.32
5.5.310.0400.02720.36
5.5.300.0070.06018.07
5.5.290.0100.07018.04
5.5.280.0100.03720.75
5.5.270.0030.07320.88
5.5.260.0100.08020.88
5.5.250.0070.08320.71
5.5.240.0370.06320.04
5.4.450.0270.05319.70
5.4.440.0600.06019.48
5.4.430.0670.06019.46
5.4.420.0300.06019.19
5.4.410.0870.05019.46
5.4.400.0570.05319.15
5.4.390.0300.05018.87
5.4.380.0170.06318.73
5.4.370.0230.04318.80
5.4.360.0200.04718.55
5.4.350.0130.05318.80
5.4.340.0130.05318.58
5.4.320.0070.04512.52
5.4.310.0090.04012.52
5.4.300.0090.03712.52
5.4.290.0070.04312.52
5.4.280.0050.03612.41
5.4.270.0050.04312.42
5.4.260.0100.04718.96
5.4.250.0030.05718.90
5.4.240.0130.05019.00
5.4.230.0070.05318.94
5.4.220.0100.05718.84
5.4.210.0070.07318.94
5.4.200.0100.06718.90
5.4.190.0100.05718.97
5.4.180.0070.07718.98
5.4.170.0130.05318.89
5.4.160.0030.06318.94
5.4.150.0030.05718.93
5.4.140.0130.04316.57
5.4.130.0100.05016.57
5.4.120.0070.07316.41
5.4.110.0200.04316.41
5.4.100.0170.05716.54
5.4.90.0130.06716.65
5.4.80.0070.05016.63
5.4.70.0000.05716.47
5.4.60.0030.05316.54
5.4.50.0030.05016.47
5.4.40.0170.06016.56
5.4.30.0070.07716.48
5.4.20.0100.04316.45
5.4.10.0200.05716.37
5.4.00.0070.05015.89
5.3.290.0030.04812.80
5.3.280.0130.05714.79
5.3.270.0100.06014.68
5.3.260.0030.07014.60
5.3.250.0030.05314.63
5.3.240.0170.07014.75
5.3.230.0030.07314.83
5.3.220.0130.05014.67
5.3.210.0130.07014.64
5.3.200.0070.05314.74
5.3.190.0100.05014.80
5.3.180.0030.05314.65
5.3.170.0100.07014.66
5.3.160.0030.05314.57
5.3.150.0030.05314.76
5.3.140.0070.07314.65
5.3.130.0100.05714.52
5.3.120.0030.05314.64
5.3.110.0070.07314.70
5.3.100.0070.05014.06
5.3.90.0200.07014.11
5.3.80.0030.05314.05
5.3.70.0070.05314.04
5.3.60.0070.05714.03
5.3.50.0100.05713.79
5.3.40.0170.04714.05
5.3.30.0170.04314.00
5.3.20.0100.04313.79
5.3.10.0070.06713.89
5.3.00.0100.04713.72
5.2.170.0030.05011.14
5.2.160.0030.04711.13
5.2.150.0000.04711.32
5.2.140.0100.04711.13
5.2.130.0000.06011.07
5.2.120.0030.05711.09
5.2.110.0100.03311.11
5.2.100.0100.03311.29
5.2.90.0000.05011.20
5.2.80.0070.04011.18
5.2.70.0100.04010.93
5.2.60.0000.04711.04
5.2.50.0200.04011.00
5.2.40.0070.04011.10
5.2.30.0170.04710.93
5.2.20.0130.05011.04
5.2.10.0070.05711.04
5.2.00.0130.04310.83
5.1.60.0130.0339.85
5.1.50.0130.04310.26
5.1.40.0070.0379.95
5.1.30.0030.03710.43
5.1.20.0030.04310.43
5.1.10.0070.0339.92
5.1.00.0000.04010.18
5.0.50.0030.0408.52
5.0.40.0100.0378.52
5.0.30.0000.0478.30
5.0.20.0000.0338.31
5.0.10.0030.0308.38
5.0.00.0000.0478.02
4.4.90.0100.0207.29
4.4.80.0100.0137.29
4.4.70.0030.0207.25
4.4.60.0070.0277.25
4.4.50.0000.0277.25
4.4.40.0070.0307.25
4.4.30.0100.0177.25
4.4.20.0030.0207.25
4.4.10.0170.0177.25
4.4.00.0070.0337.25
4.3.110.0070.0207.25
4.3.100.0030.0307.25
4.3.90.0000.0237.25
4.3.80.0070.0377.25
4.3.70.0000.0237.25
4.3.60.0030.0207.25
4.3.50.0070.0277.25
4.3.40.0130.0237.25
4.3.30.0000.0237.25
4.3.20.0070.0277.25
4.3.10.0000.0307.25
4.3.00.0130.0178.10

preferences:
39.71 ms | 401 KiB | 5 Q