3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Connection { protected $link; private $server, $username, $password, $db; public function __construct($server, $username, $password, $db) { $this->server = $server; $this->username = $username; $this->password = $password; $this->db = $db; $this->connect(); } private function connect() { $this->link = mysql_connect($this->server, $this->username, $this->password); mysql_select_db($this->db, $this->link); } public function __sleep() { return array('server', 'username', 'password', 'db'); } public function __wakeup() { $this->connect(); } public function sta(){ echo $server1; echo $username1; echo $password1; echo $db1; } } $conect= new Connection('server1', 'username1', 'password1', 'db1'); $connect->sta(); ?>

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.43
8.3.50.0090.01021.98
8.3.40.0140.00019.02
8.3.30.0040.01218.66
8.3.20.0080.00018.85
8.3.10.0040.00420.39
8.3.00.0000.00823.51
8.2.180.0100.01016.75
8.2.170.0070.00722.96
8.2.160.0100.00320.31
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0050.00319.48
8.2.110.0050.00522.11
8.2.100.0110.00017.78
8.2.90.0040.00419.15
8.2.80.0050.00317.97
8.2.70.0040.00417.50
8.2.60.0030.01017.65
8.2.50.0090.00018.07
8.2.40.0080.00018.09
8.2.30.0030.00619.79
8.2.20.0040.00417.66
8.2.10.0040.00417.75
8.2.00.0000.00817.69
8.1.270.0060.00323.99
8.1.260.0030.00626.35
8.1.250.0080.00028.09
8.1.240.0000.01120.44
8.1.230.0080.00320.96
8.1.220.0050.00318.77
8.1.210.0000.00818.89
8.1.200.0030.00617.23
8.1.190.0000.00717.41
8.1.180.0080.00018.10
8.1.170.0080.00018.52
8.1.160.0000.00718.84
8.1.150.0050.00218.52
8.1.140.0030.00517.25
8.1.130.0030.00317.78
8.1.120.0030.00517.40
8.1.110.0080.00017.36
8.1.100.0030.00517.29
8.1.90.0000.00717.43
8.1.80.0040.00417.31
8.1.70.0030.00317.43
8.1.60.0000.00917.56
8.1.50.0000.00917.48
8.1.40.0040.00417.52
8.1.30.0000.00817.67
8.1.20.0000.00917.66
8.1.10.0040.00417.61
8.1.00.0080.00017.53
8.0.300.0040.00419.73
8.0.290.0000.00716.93
8.0.280.0070.00018.41
8.0.270.0030.00317.25
8.0.260.0030.00316.86
8.0.250.0040.00416.91
8.0.240.0000.00816.85
8.0.230.0030.00316.97
8.0.220.0040.00416.90
8.0.210.0030.00316.83
8.0.200.0030.00316.91
8.0.190.0000.00816.87
8.0.180.0050.00316.96
8.0.170.0040.00416.96
8.0.160.0080.00016.91
8.0.150.0080.00316.94
8.0.140.0030.00516.83
8.0.130.0050.00013.30
8.0.120.0040.00416.71
8.0.110.0000.00716.91
8.0.100.0000.00716.77
8.0.90.0000.00816.91
8.0.80.0090.01016.94
8.0.70.0030.00516.75
8.0.60.0040.00416.78
8.0.50.0040.00416.95
8.0.30.0080.01117.04
8.0.20.0090.00817.42
8.0.10.0040.00416.99
8.0.00.0130.00716.74
7.4.330.0050.00014.68
7.4.320.0050.00216.35
7.4.300.0000.00616.47
7.4.290.0030.00316.63
7.4.280.0080.00016.48
7.4.270.0000.00716.46
7.4.260.0030.00313.23
7.4.250.0070.00016.49
7.4.240.0060.00316.55
7.4.230.0000.00716.39
7.4.220.0140.00316.51
7.4.210.0070.00816.48
7.4.200.0030.00516.58
7.4.190.0000.00716.56
7.4.160.0030.01216.67
7.4.150.0120.01217.40
7.4.140.0080.00917.86
7.4.130.0060.01116.49
7.4.120.0150.00416.56
7.4.110.0150.03016.49
7.4.100.0110.01116.54
7.4.90.0090.01216.54
7.4.80.0040.01219.04
7.4.70.0150.00716.47
7.4.60.0100.00716.41
7.4.50.0000.00716.41
7.4.40.0060.01022.27
7.4.30.0040.01516.48
7.4.00.0040.01115.23
7.3.330.0000.00613.21
7.3.320.0000.00513.42
7.3.310.0030.00316.40
7.3.300.0000.00616.48
7.3.290.0090.00616.38
7.3.280.0090.00916.36
7.3.270.0180.00317.40
7.3.260.0100.00918.24
7.3.250.0070.01116.46
7.3.240.0100.00716.54
7.3.230.0070.01016.39
7.3.210.0130.01016.50
7.3.200.0070.01019.39
7.3.190.0100.01016.32
7.3.180.0130.00316.36
7.3.170.0030.01416.59
7.3.160.0090.00616.59
7.3.120.0090.00614.84
7.2.330.0000.01716.35
7.2.320.0140.00316.57
7.2.310.0070.01416.58
7.2.300.0090.00816.38
7.2.290.0100.01416.67
7.2.60.0040.01116.78
7.2.00.0000.01419.20
7.1.200.0000.01315.68
7.1.100.0120.00017.80
7.1.70.0030.00616.89
7.1.60.0040.02219.40
7.1.50.0000.01216.86
7.1.00.0000.03722.57
7.0.200.0050.00316.50
7.0.140.0070.07022.00
7.0.70.0130.07721.71
7.0.60.0100.08021.74
7.0.50.0030.08722.07
7.0.40.0070.08020.10
7.0.30.0000.09020.11
7.0.20.0000.09320.04
7.0.10.0130.07320.13
7.0.00.0100.06320.11
5.6.280.0030.07320.93
5.6.220.0170.06320.63
5.6.210.0000.08720.58
5.6.200.0000.09320.95
5.6.190.0000.07021.05
5.6.180.0000.08321.18
5.6.170.0000.09021.11
5.6.160.0070.06321.03
5.6.150.0030.08321.02
5.6.140.0070.09020.95
5.6.130.0070.07721.11
5.6.120.0100.08021.02
5.6.110.0030.08721.11
5.6.100.0000.05321.11
5.6.90.0070.04721.10
5.6.80.0070.04720.41
5.6.70.0070.06020.43
5.6.60.0030.07020.45
5.6.50.0070.08320.48
5.6.40.0100.07020.41
5.6.30.0000.08720.39
5.6.20.0030.07720.41
5.6.10.0030.06020.53
5.6.00.0100.06720.43
5.5.360.0030.07720.37
5.5.350.0030.06320.39
5.5.340.0030.08320.93
5.5.330.0130.07720.88
5.5.320.0030.08320.82
5.5.310.0030.08320.91
5.5.300.0000.08020.65
5.5.290.0130.07720.80
5.5.280.0030.05320.84
5.5.270.0030.05320.64
5.5.260.0030.04020.91
5.5.250.0130.07320.61
5.5.240.0100.07020.16
5.5.230.0070.07020.16
5.5.220.0030.08020.12
5.5.210.0070.07720.19
5.5.200.0070.05320.28
5.5.190.0100.07720.19
5.5.180.0030.08020.19
5.5.160.0130.05020.14
5.5.150.0070.05020.16
5.5.140.0070.06720.25
5.5.130.0100.05720.25
5.5.120.0030.08720.27
5.5.110.0000.05320.19
5.5.100.0030.06320.13
5.5.90.0030.04719.95
5.5.80.0130.05720.17
5.5.70.0030.04320.16
5.5.60.0070.04720.10
5.5.50.0070.06020.01
5.5.40.0070.06320.09
5.5.30.0030.06320.09
5.5.20.0030.07720.10
5.5.10.0000.08320.12
5.5.00.0000.06720.07
5.4.450.0030.07019.54
5.4.440.0070.05719.56
5.4.430.0000.08019.19
5.4.420.0030.07719.23
5.4.410.0030.03719.32
5.4.400.0100.07319.05
5.4.390.0030.06019.21
5.4.380.0030.07018.89
5.4.370.0070.06319.13
5.4.360.0070.07019.03
5.4.350.0030.05018.95
5.4.340.0030.05318.85
5.4.320.0100.06719.16
5.4.310.0030.06718.88
5.4.300.0070.06019.21
5.4.290.0000.04719.09
5.4.280.0000.08018.90
5.4.270.0070.06319.24
5.4.260.0170.07018.94
5.4.250.0070.04019.12
5.4.240.0030.06718.89
5.4.230.0000.04319.02
5.4.220.0030.03719.04
5.4.210.0030.06319.24
5.4.200.0030.08018.94
5.4.190.0030.05319.02
5.4.180.0100.07019.04
5.4.170.0100.04719.11
5.4.160.0030.06718.88
5.4.150.0030.05319.18
5.4.140.0100.05716.18
5.4.130.0000.07716.22
5.4.120.0030.05316.34
5.4.110.0070.07016.42
5.4.100.0000.07316.39
5.4.90.0030.07316.34
5.4.80.0000.07716.32
5.4.70.0030.07316.43
5.4.60.0000.05316.30
5.4.50.0070.03316.31
5.4.40.0000.03716.49
5.4.30.0070.07016.44
5.4.20.0030.07316.43
5.4.10.0000.06316.48
5.4.00.0070.06315.75
5.3.290.0000.08714.65
5.3.280.0070.03314.70
5.3.270.0100.06314.63
5.3.260.0000.06714.54
5.3.250.0100.06014.66
5.3.240.0000.06014.60
5.3.230.0030.04014.70
5.3.220.0100.05714.56
5.3.210.0030.07314.59
5.3.200.0000.06314.61
5.3.190.0030.04314.56
5.3.180.0070.07014.59
5.3.170.0070.07314.71
5.3.160.0030.07714.57
5.3.150.0000.06314.62
5.3.140.0070.03314.57
5.3.130.0030.07314.57
5.3.120.0000.04314.62
5.3.110.0070.05714.57
5.3.100.0030.07314.11
5.3.90.0030.06714.15
5.3.80.0100.06314.14
5.3.70.0070.07314.12
5.3.60.0030.07314.04
5.3.50.0030.07314.02
5.3.40.0030.06013.96
5.3.30.0070.04014.03
5.3.20.0070.07013.81
5.3.10.0030.06713.77
5.3.00.0000.07713.75
5.2.170.0030.06311.09
5.2.160.0030.04711.09
5.2.150.0000.06711.14
5.2.140.0000.03711.09
5.2.130.0030.06011.18
5.2.120.0000.04311.09
5.2.110.0000.04311.17
5.2.100.0000.06311.25
5.2.90.0000.04011.20
5.2.80.0000.06311.21
5.2.70.0100.05311.13
5.2.60.0030.06311.09
5.2.50.0070.05011.09
5.2.40.0000.06011.09
5.2.30.0070.05711.09
5.2.20.0100.05311.09
5.2.10.0000.04711.09
5.2.00.0070.05711.09
5.1.60.0030.04311.09
5.1.50.0000.04311.09
5.1.40.0070.04311.09
5.1.30.0030.05311.09
5.1.20.0100.03711.09
5.1.10.0030.05711.09
5.1.00.0130.03311.09
5.0.50.0030.04311.09
5.0.40.0030.04311.09
5.0.30.0000.06011.09
5.0.20.0000.03011.09
5.0.10.0000.03711.09
5.0.00.0070.05711.09
4.4.90.0030.03711.09
4.4.80.0030.03311.09
4.4.70.0030.02311.09
4.4.60.0030.03311.09
4.4.50.0000.03711.09
4.4.40.0000.04711.09
4.4.30.0030.02311.09
4.4.20.0030.02011.09
4.4.10.0000.03711.09
4.4.00.0000.05311.09
4.3.110.0000.03711.09
4.3.100.0000.02311.09
4.3.90.0000.03711.09
4.3.80.0030.04011.09
4.3.70.0000.02011.09
4.3.60.0000.03711.09
4.3.50.0000.03011.09
4.3.40.0030.05011.09
4.3.30.0030.03011.09
4.3.20.0030.03011.09
4.3.10.0030.03711.09
4.3.00.0030.02711.09

preferences:
50.87 ms | 400 KiB | 5 Q