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->array(); } public function a(){ echo $server; echo $username; echo $password; echo $db; } } $conect= new Connection('server1', 'username1', 'password1', 'db1'); $connect->a(); ?>

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.0070.01118.43
8.3.50.0120.00822.00
8.3.40.0120.00318.61
8.3.30.0070.01418.96
8.3.20.0050.00320.32
8.3.10.0040.00422.08
8.3.00.0080.00022.58
8.2.180.0120.00917.00
8.2.170.0120.00922.96
8.2.160.0070.00720.95
8.2.150.0000.00924.18
8.2.140.0090.00624.66
8.2.130.0040.00426.16
8.2.120.0110.00417.50
8.2.110.0110.00722.06
8.2.100.0070.00417.84
8.2.90.0000.00819.09
8.2.80.0000.00817.97
8.2.70.0110.00017.38
8.2.60.0040.00417.93
8.2.50.0000.00818.07
8.2.40.0060.00318.09
8.2.30.0040.00418.07
8.2.20.0000.00817.69
8.2.10.0040.00417.79
8.2.00.0030.00617.64
8.1.280.0100.01025.92
8.1.270.0070.00024.01
8.1.260.0060.00326.35
8.1.250.0060.00928.09
8.1.240.0070.00318.32
8.1.230.0030.00719.17
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0030.00617.23
8.1.190.0040.00417.43
8.1.180.0000.00818.10
8.1.170.0000.00818.56
8.1.160.0040.00421.97
8.1.150.0030.00518.49
8.1.140.0000.00717.34
8.1.130.0030.00317.85
8.1.120.0050.00217.36
8.1.110.0040.00317.38
8.1.100.0080.00017.45
8.1.90.0080.00317.41
8.1.80.0000.00717.43
8.1.70.0000.00717.43
8.1.60.0100.00017.64
8.1.50.0040.00417.59
8.1.40.0000.00717.54
8.1.30.0080.00017.61
8.1.20.0040.00417.68
8.1.10.0040.00417.66
8.1.00.0060.00317.44
8.0.300.0050.00318.77
8.0.290.0070.00017.04
8.0.280.0000.00718.41
8.0.270.0000.00717.22
8.0.260.0080.00016.75
8.0.250.0070.00017.02
8.0.240.0000.00716.98
8.0.230.0040.00416.96
8.0.220.0000.00716.82
8.0.210.0000.00716.86
8.0.200.0070.00016.96
8.0.190.0000.00717.00
8.0.180.0060.00316.91
8.0.170.0040.00416.87
8.0.160.0080.00016.93
8.0.150.0040.00416.84
8.0.140.0070.00016.77
8.0.130.0030.00313.39
8.0.120.0030.00516.86
8.0.110.0000.00816.90
8.0.100.0040.00416.86
8.0.90.0000.00716.79
8.0.80.0130.00716.93
8.0.70.0050.00316.80
8.0.60.0040.00416.77
8.0.50.0070.00016.70
8.0.30.0140.00517.09
8.0.20.0110.01017.40
8.0.10.0040.00416.99
8.0.00.0090.00816.86
7.4.330.0020.00315.00
7.4.320.0030.00316.42
7.4.300.0030.00316.55
7.4.290.0050.00316.47
7.4.280.0070.00016.46
7.4.270.0000.00716.41
7.4.260.0000.00716.54
7.4.250.0040.00416.41
7.4.240.0030.00516.48
7.4.230.0000.00716.42
7.4.220.0000.01916.67
7.4.210.0060.01316.54
7.4.200.0020.00516.56
7.4.190.0050.00316.43
7.4.160.0150.00016.57
7.4.150.0130.00617.40
7.4.140.0140.00817.86
7.4.130.0100.00716.42
7.4.120.0120.00716.46
7.4.110.0150.00316.50
7.4.100.0070.01016.46
7.4.90.0130.01016.39
7.4.80.0030.01516.46
7.4.70.0090.00816.47
7.4.60.0070.01016.61
7.4.50.0040.00416.61
7.4.40.0070.00722.77
7.4.30.0120.00416.21
7.4.00.0070.01214.92
7.3.330.0000.00613.45
7.3.320.0000.00513.37
7.3.310.0040.00216.38
7.3.300.0070.00016.38
7.3.290.0030.01616.37
7.3.280.0060.01216.36
7.3.270.0110.01117.40
7.3.260.0120.00916.66
7.3.250.0110.00916.39
7.3.240.0130.00416.35
7.3.230.0060.01216.56
7.3.210.0120.00616.42
7.3.200.0090.01219.39
7.3.190.0130.00716.45
7.3.180.0150.00616.67
7.3.170.0130.00316.32
7.3.160.0120.00516.61
7.3.120.0050.01114.88
7.3.110.0100.00614.91
7.3.100.0070.00614.77
7.3.90.0060.00714.80
7.3.80.0100.00514.75
7.3.70.0070.00514.87
7.3.60.0040.01114.71
7.3.50.0090.00614.87
7.3.40.0050.01014.84
7.3.30.0050.00714.76
7.3.20.0060.00816.64
7.3.10.0030.01216.55
7.3.00.0080.00516.58
7.2.330.0100.00716.63
7.2.320.0070.01016.66
7.2.310.0100.00716.63
7.2.300.0100.00716.59
7.2.290.0130.00316.78
7.2.250.0070.01214.96
7.2.240.0030.01514.84
7.2.230.0100.00514.95
7.2.220.0070.00714.96
7.2.210.0060.00814.90
7.2.200.0050.00914.97
7.2.190.0050.01014.94
7.2.180.0060.00914.79
7.2.170.0070.00514.94
7.2.160.0020.01314.80
7.2.150.0060.01316.59
7.2.140.0060.00716.62
7.2.130.0090.00516.82
7.2.120.0050.00916.67
7.2.110.0060.00916.85
7.2.100.0060.00816.79
7.2.90.0090.00616.83
7.2.80.0110.00516.67
7.2.70.0080.00616.88
7.2.60.0050.00816.68
7.2.50.0020.01016.79
7.2.40.0000.01416.85
7.2.30.0070.01016.83
7.2.20.0030.01016.93
7.2.10.0090.00616.58
7.2.00.0070.00517.66
7.1.330.0060.00615.55
7.1.320.0060.00715.72
7.1.310.0040.00715.68
7.1.300.0020.00915.65
7.1.290.0080.00615.45
7.1.280.0050.00815.52
7.1.270.0090.00715.48
7.1.260.0020.01015.63
7.1.250.0060.01115.44
7.1.200.0040.00715.77
7.1.100.0040.00717.87
7.1.70.0000.00717.01
7.1.60.0130.01319.82
7.1.50.0000.01016.51
7.1.00.0000.08022.44
7.0.200.0060.00616.57
7.0.140.0000.07322.12
7.0.60.0200.08019.87
7.0.50.0070.03717.82
7.0.40.0100.06320.24
7.0.30.0230.04720.13
7.0.20.0170.08320.09
7.0.10.0170.04020.12
7.0.00.0070.08020.25
5.6.280.0030.07321.07
5.6.210.0100.08020.54
5.6.200.0030.08318.19
5.6.190.0070.08720.51
5.6.180.3570.03320.48
5.6.170.0230.06020.56
5.6.160.0070.03720.57
5.6.150.0100.05318.19
5.6.140.0130.07718.18
5.6.130.0070.08318.21
5.6.120.0000.08721.00
5.6.110.0100.07721.12
5.6.100.0070.08321.13
5.6.90.0030.04321.00
5.6.80.0100.08020.40
5.5.350.0230.07020.46
5.5.340.0070.03717.94
5.5.330.0130.06020.27
5.5.320.0470.04720.28
5.5.310.0300.07320.29
5.5.300.0030.04018.04
5.5.290.0070.08717.95
5.5.280.0030.04020.88
5.5.270.0030.09020.77
5.5.260.0200.07320.73
5.5.250.0170.05320.78
5.5.240.0200.08020.13
5.4.450.0400.03319.39
5.4.440.0670.04719.48
5.4.430.0200.04019.56
5.4.420.0130.04319.45
5.4.410.0100.05718.71
5.4.400.0130.05018.67
5.4.390.0170.04718.79
5.4.380.0230.05018.48
5.4.370.0270.05018.74
5.4.360.0330.06718.81
5.4.350.0300.05018.83
5.4.340.0300.05018.55
5.4.320.0070.04312.51
5.4.310.0080.04612.51
5.4.300.0060.04112.51
5.4.290.0050.04512.51
5.4.280.0030.03812.41
5.4.270.0070.03512.40
5.4.260.0050.04012.40
5.4.250.0070.03912.40
5.4.240.0110.04112.41
5.4.230.0060.04512.39
5.4.220.0110.03512.39
5.4.210.0070.03312.39
5.4.200.0030.04312.40
5.4.190.0200.04412.39
5.4.180.0160.04812.38
5.4.170.0140.04812.40
5.4.160.0180.04212.39
5.4.150.0160.04612.39
5.4.140.0150.04512.07
5.4.130.0160.04412.05
5.4.120.0140.04312.02
5.4.110.0120.05012.02
5.4.100.0160.04612.01
5.4.90.0220.04212.02
5.4.80.0150.04612.01
5.4.70.0200.04012.00
5.4.60.0200.04312.00
5.4.50.0160.04212.01
5.4.40.0240.04012.00
5.4.30.0160.04811.99
5.4.20.0150.04911.99
5.4.10.0170.04712.00
5.4.00.0300.08911.48
5.3.290.0070.04212.80
5.3.280.0070.04312.71
5.3.270.0250.04612.72
5.3.260.0230.04412.72
5.3.250.0160.05112.72
5.3.240.0250.05112.72
5.3.230.0220.04812.71
5.3.220.0180.04612.68
5.3.210.0190.04912.68
5.3.200.0200.04612.68
5.3.190.0210.04612.67
5.3.180.0240.04012.67
5.3.170.0140.04712.67
5.3.160.0190.04412.67
5.3.150.0160.04412.67
5.3.140.0230.04012.66
5.3.130.0180.04412.66
5.3.120.0170.04612.66
5.3.110.0160.04812.66
5.3.100.0190.04512.13
5.3.90.0180.04412.11
5.3.80.0200.04412.10
5.3.70.0210.07112.10
5.3.60.0160.04712.09
5.3.50.0180.04412.03
5.3.40.0100.05012.04
5.3.30.0170.04312.01
5.3.20.0180.04611.78
5.3.10.0090.04811.74
5.3.00.0160.04311.72
5.2.170.0150.0359.23
5.2.160.0120.0369.22
5.2.150.0160.0339.22
5.2.140.0130.0369.23
5.2.130.0110.0379.19
5.2.120.0110.0379.18
5.2.110.0180.0329.20
5.2.100.0130.0379.20
5.2.90.0170.0329.19
5.2.80.0110.0379.18
5.2.70.0170.0339.19
5.2.60.0170.0309.14
5.2.50.0120.0369.11
5.2.40.0150.0339.09
5.2.30.0140.0329.05
5.2.20.0160.0339.06
5.2.10.0120.0358.96
5.2.00.0140.0318.81
5.1.60.0130.0278.10
5.1.50.0130.0308.09
5.1.40.0090.0348.08
5.1.30.0090.0348.42
5.1.20.0120.0318.45
5.1.10.0090.0358.17
5.1.00.0160.0268.17
5.0.50.0120.0246.65
5.0.40.0080.0256.50
5.0.30.0080.0376.32
5.0.20.0110.0236.30
5.0.10.0050.0296.27
5.0.00.0110.0346.27
4.4.90.0070.0194.78
4.4.80.0060.0204.76
4.4.70.0100.0174.75
4.4.60.0070.0204.75
4.4.50.0070.0184.77
4.4.40.0060.0324.70
4.4.30.0080.0204.76
4.4.20.0100.0154.85
4.4.10.0100.0154.85
4.4.00.0040.0324.76
4.3.110.0050.0214.67
4.3.100.0070.0184.67
4.3.90.0070.0194.63
4.3.80.0060.0304.58
4.3.70.0100.0184.63
4.3.60.0040.0224.63
4.3.50.0100.0184.63
4.3.40.0080.0284.54
4.3.30.0110.0173.29
4.3.20.0100.0163.29
4.3.10.0100.0173.24
4.3.00.0030.01713.17

preferences:
38.37 ms | 401 KiB | 5 Q