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.0090.00618.55
8.3.50.0150.00521.02
8.3.40.0100.00718.83
8.3.30.0030.01019.07
8.3.20.0040.01120.34
8.3.10.0000.00822.09
8.3.00.0000.00820.77
8.2.180.0060.01016.50
8.2.170.0110.00422.96
8.2.160.0080.00819.19
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0190.00026.16
8.2.120.0080.00019.38
8.2.110.0040.00420.60
8.2.100.0040.00718.03
8.2.90.0040.00419.34
8.2.80.0030.00618.02
8.2.70.0080.00017.75
8.2.60.0040.00418.05
8.2.50.0080.00018.07
8.2.40.0040.00418.16
8.2.30.0040.00418.13
8.2.20.0030.00617.63
8.2.10.0040.00417.66
8.2.00.0000.00817.68
8.1.280.0140.00625.92
8.1.270.0050.00322.01
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0060.00323.91
8.1.230.0110.00019.16
8.1.220.0050.00317.79
8.1.210.0000.00818.77
8.1.200.0030.00617.35
8.1.190.0040.00417.40
8.1.180.0050.00318.70
8.1.170.0060.00318.57
8.1.160.0050.00322.05
8.1.150.0040.00418.54
8.1.140.0040.00417.56
8.1.130.0000.00717.77
8.1.120.0000.00717.55
8.1.110.0030.00617.39
8.1.100.0000.00717.35
8.1.90.0000.00717.48
8.1.80.0000.00817.34
8.1.70.0030.00317.30
8.1.60.0030.00617.61
8.1.50.0040.00417.53
8.1.40.0040.00417.54
8.1.30.0050.00317.63
8.1.20.0080.00017.70
8.1.10.0000.00817.59
8.1.00.0040.00417.45
8.0.300.0040.00418.77
8.0.290.0000.00817.18
8.0.280.0050.00318.53
8.0.270.0030.00317.16
8.0.260.0030.00316.72
8.0.250.0030.00316.89
8.0.240.0030.00317.00
8.0.230.0030.00316.92
8.0.220.0070.00016.91
8.0.210.0040.00416.91
8.0.200.0050.00216.97
8.0.190.0040.00417.03
8.0.180.0000.00816.99
8.0.170.0080.00016.90
8.0.160.0000.00816.91
8.0.150.0040.00416.74
8.0.140.0040.00416.88
8.0.130.0050.00013.42
8.0.120.0030.00617.00
8.0.110.0040.00416.90
8.0.100.0030.00516.95
8.0.90.0040.00416.75
8.0.80.0150.00616.95
8.0.70.0040.00416.78
8.0.60.0000.00816.95
8.0.50.0040.00416.75
8.0.30.0150.00717.17
8.0.20.0070.01017.40
8.0.10.0000.00716.93
8.0.00.0100.00716.77
7.4.330.0020.00215.10
7.4.320.0050.00216.55
7.4.300.0030.00316.67
7.4.290.0000.00716.61
7.4.280.0040.00416.60
7.4.270.0070.00016.49
7.4.260.0040.00416.54
7.4.250.0040.00416.54
7.4.240.0040.00316.57
7.4.230.0070.00016.51
7.4.220.0160.00616.57
7.4.210.0110.00616.60
7.4.200.0030.00516.33
7.4.190.0050.00316.80
7.4.160.0090.00616.29
7.4.150.0090.00917.40
7.4.140.0100.00817.86
7.4.130.0180.00316.61
7.4.120.0090.00916.57
7.4.110.0030.02016.55
7.4.100.0140.00616.65
7.4.90.0140.00316.52
7.4.80.0130.00319.39
7.4.70.0090.00916.36
7.4.60.0030.01216.58
7.4.50.0040.00416.64
7.4.40.0100.00522.77
7.4.30.0110.00916.65
7.4.00.0070.00714.91
7.3.330.0000.00513.43
7.3.320.0000.00513.25
7.3.310.0030.00316.36
7.3.300.0030.00316.41
7.3.290.0000.01416.36
7.3.280.0140.00516.35
7.3.270.0080.00817.40
7.3.260.0140.00416.52
7.3.250.0060.01116.29
7.3.240.0070.01116.55
7.3.230.0090.01216.52
7.3.210.0100.00716.47
7.3.200.0100.00619.39
7.3.190.0110.00716.62
7.3.180.0090.00616.35
7.3.170.0040.01816.35
7.3.160.0120.00316.30
7.3.120.0060.00614.77
7.2.330.0090.00916.86
7.2.320.0150.00316.80
7.2.310.0000.01616.75
7.2.300.0100.00716.71
7.2.290.0060.01016.78
7.2.80.0040.01116.61
7.2.60.0000.01016.82
7.1.200.0070.00415.64
7.1.70.0000.00917.16
7.1.60.0090.01219.82
7.1.50.0040.01116.89
7.1.00.0000.07722.31
7.0.200.0040.00416.67
7.0.140.0000.07721.93
7.0.110.0000.09020.00
7.0.100.0100.07320.06
7.0.90.0130.08719.96
7.0.80.0030.08319.94
7.0.70.0070.09020.07
7.0.60.0030.04720.00
7.0.50.0130.07320.33
7.0.40.0030.08020.20
7.0.30.0100.08020.19
7.0.20.0030.04719.96
7.0.10.0100.05020.07
7.0.00.0000.09320.03
5.6.280.0100.06721.10
5.6.260.0030.08720.75
5.6.250.0170.06720.59
5.6.240.0070.08020.73
5.6.230.0070.05320.55
5.6.220.0170.07720.71
5.6.210.0100.07320.73
5.6.200.0170.06721.06
5.6.190.0070.08721.04
5.6.180.0170.07021.15
5.6.170.0000.08721.15
5.6.160.0130.07321.15
5.6.150.0100.08021.10
5.6.140.0130.07721.23
5.6.130.0070.08321.27
5.6.120.0100.05020.96
5.6.110.0070.06020.93
5.6.100.0070.05021.18
5.6.90.0030.08021.06
5.6.80.0000.08320.53
5.6.70.0100.06720.52
5.6.60.0030.08020.52
5.6.50.0070.08720.61
5.6.40.0000.09020.48
5.6.30.0130.04020.31
5.6.20.0130.06720.55
5.6.10.0070.07320.32
5.6.00.0100.04320.43
5.5.380.0130.07720.30
5.5.370.0100.07020.58
5.5.360.0070.08320.52
5.5.350.0070.09020.42
5.5.340.0030.08020.97
5.5.330.0070.08320.88
5.5.320.0130.04720.98
5.5.310.0130.06720.76
5.5.300.0000.08020.82
5.5.290.0070.08320.89
5.5.280.0100.08320.91
5.5.270.0000.08720.95
5.5.260.0130.08321.02
5.5.250.0100.08020.73
5.5.240.0200.06720.34
5.5.230.0030.05020.15
5.5.220.0070.06020.13
5.5.210.0070.08020.05
5.5.200.0130.07720.06
5.5.190.0070.08020.40
5.5.180.0100.08020.38
5.5.160.0100.07720.20
5.5.150.0100.07320.33
5.5.140.0070.07320.34
5.5.130.0070.04720.16
5.5.120.0070.07320.31
5.5.110.0000.08020.23
5.5.100.0070.07720.17
5.5.90.0070.06720.06
5.5.80.0030.06320.03
5.5.70.0100.06720.09
5.5.60.0070.07720.25
5.5.50.0100.07320.05
5.5.40.0070.07720.11
5.5.30.0070.06719.98
5.5.20.0030.07720.20
5.5.10.0100.07720.25
5.5.00.0030.08020.23
5.4.450.0000.08319.32
5.4.440.0100.07719.28
5.4.430.0070.07719.46
5.4.420.0030.05719.31
5.4.410.0000.04719.22
5.4.400.0100.06719.19
5.4.390.0100.08019.23
5.4.380.0100.07019.01
5.4.370.0100.07719.18
5.4.360.0030.07319.04
5.4.350.0000.07319.22
5.4.340.0130.06719.01
5.4.320.0130.07018.99
5.4.310.0130.06719.18
5.4.300.0170.06319.16
5.4.290.0000.07018.95
5.4.280.0070.07719.33
5.4.270.0070.06319.00
5.4.260.0070.06718.99
5.4.250.0030.06719.32
5.4.240.0070.03319.00
5.4.230.0070.04719.17
5.4.220.0100.06319.13
5.4.210.0030.07719.31
5.4.200.0030.03719.09
5.4.190.0100.07019.15
5.4.180.0100.07019.07
5.4.170.0130.04318.99
5.4.160.0030.07018.98
5.4.150.0100.07018.93
5.4.140.0070.04716.59
5.4.130.0100.04316.38
5.4.120.0070.07016.52
5.4.110.0000.07316.50
5.4.100.0070.06716.27
5.4.90.0030.07316.41
5.4.80.0070.07016.46
5.4.70.0100.06716.54
5.4.60.0030.07016.48
5.4.50.0100.06316.40
5.4.40.0000.08316.61
5.4.30.0030.04716.50
5.4.20.0070.06016.28
5.4.10.0000.08316.47
5.4.00.0030.05315.82
5.3.290.0070.04714.64
5.3.280.0030.07314.84
5.3.270.0000.07714.71
5.3.260.0030.04714.70
5.3.250.0030.07314.48
5.3.240.0100.07014.84
5.3.230.0030.07014.64
5.3.220.0130.07314.59
5.3.210.0070.07714.59
5.3.200.0130.07314.43
5.3.190.0100.07014.60
5.3.180.0130.06014.66
5.3.170.0030.05014.59
5.3.160.0000.04014.71
5.3.150.0170.06314.55
5.3.140.0100.07014.64
5.3.130.0000.04714.79
5.3.120.0030.06014.79
5.3.110.0030.04714.64
5.3.100.0070.08014.09
5.3.90.0030.08013.89
5.3.80.0070.07314.12
5.3.70.0070.07714.04
5.3.60.0030.07714.03
5.3.50.0070.07314.04
5.3.40.0030.07313.97
5.3.30.0100.06713.93
5.3.20.0070.07013.84
5.3.10.0100.07013.70
5.3.00.0070.06713.51
5.2.170.0070.05312.20
5.2.160.0100.04712.20
5.2.150.0000.04312.20
5.2.140.0000.06712.20
5.2.130.0030.06012.20
5.2.120.0030.05712.20
5.2.110.0070.06012.20
5.2.100.0100.04312.20
5.2.90.0000.06712.20
5.2.80.0070.04712.20
5.2.70.0100.05012.20
5.2.60.0100.06012.20
5.2.50.0070.05712.20
5.2.40.0030.05312.20
5.2.30.0000.06712.20
5.2.20.0070.06012.20
5.2.10.0000.06312.20
5.2.00.0100.05712.20
5.1.60.0000.03312.20
5.1.50.0100.05012.20
5.1.40.0000.03312.20
5.1.30.0070.05312.20
5.1.20.0100.03712.20
5.1.10.0100.05012.20
5.1.00.0030.05312.20
5.0.50.0030.05012.20
5.0.40.0030.04312.20
5.0.30.0000.06312.20
5.0.20.0130.03312.20
5.0.10.0030.04712.20
5.0.00.0000.06712.20
4.4.90.0000.03312.20
4.4.80.0030.03312.20
4.4.70.0030.03312.20
4.4.60.0030.02712.20
4.4.50.0030.03312.20
4.4.40.0000.05712.20
4.4.30.0030.03712.20
4.4.20.0030.03312.20
4.4.10.0070.02712.20
4.4.00.0070.04712.20
4.3.110.0030.03712.20
4.3.100.0030.03312.20
4.3.90.0000.04012.20
4.3.80.0030.05712.20
4.3.70.0070.03312.20
4.3.60.0070.01712.20
4.3.50.0000.04012.20
4.3.40.0000.04712.20
4.3.30.0070.02312.20
4.3.20.0070.03012.20
4.3.10.0000.04012.20
4.3.00.0000.03312.20

preferences:
37.28 ms | 401 KiB | 5 Q