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 nect() { $this->link = array($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 $server; echo $username; echo $password; echo $db; } } $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.0200.00018.29
8.3.50.0110.01121.33
8.3.40.0130.00418.87
8.3.30.0090.00618.83
8.3.20.0000.00818.78
8.3.10.0040.00421.04
8.3.00.0020.00523.61
8.2.180.0090.00616.75
8.2.170.0070.00722.96
8.2.160.0030.01020.35
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0040.00421.00
8.2.110.0060.00320.36
8.2.100.0120.00017.84
8.2.90.0080.00019.19
8.2.80.0050.00318.04
8.2.70.0030.00517.50
8.2.60.0060.00317.68
8.2.50.0040.00418.07
8.2.40.0050.00317.91
8.2.30.0050.00519.37
8.2.20.0000.00717.71
8.2.10.0000.00717.61
8.2.00.0040.00717.59
8.1.280.0160.00625.92
8.1.270.0080.00023.99
8.1.260.0060.00326.35
8.1.250.0000.00728.09
8.1.240.0100.00022.33
8.1.230.0040.00820.87
8.1.220.0050.00318.77
8.1.210.0060.00318.84
8.1.200.0100.00017.23
8.1.190.0040.00417.50
8.1.180.0050.00318.10
8.1.170.0000.00818.67
8.1.160.0020.00518.78
8.1.150.0030.00718.57
8.1.140.0000.00817.36
8.1.130.0080.00017.74
8.1.120.0040.00317.35
8.1.110.0030.00617.30
8.1.100.0070.00017.39
8.1.90.0040.00417.48
8.1.80.0000.00717.39
8.1.70.0000.00717.30
8.1.60.0040.00417.52
8.1.50.0070.00017.51
8.1.40.0040.00417.45
8.1.30.0030.00517.59
8.1.20.0040.00417.57
8.1.10.0000.00817.45
8.1.00.0000.00717.56
8.0.300.0040.00419.91
8.0.290.0000.00917.05
8.0.280.0000.00818.44
8.0.270.0040.00417.18
8.0.260.0030.00316.83
8.0.250.0070.00016.85
8.0.240.0040.00416.95
8.0.230.0000.00716.91
8.0.220.0000.00716.80
8.0.210.0030.00316.91
8.0.200.0000.00617.01
8.0.190.0000.00716.88
8.0.180.0040.00416.87
8.0.170.0000.00717.00
8.0.160.0000.00716.91
8.0.150.0040.00316.73
8.0.140.0070.00016.93
8.0.130.0030.00313.28
8.0.120.0000.00716.80
8.0.110.0040.00416.86
8.0.100.0030.00516.89
8.0.90.0050.00216.98
8.0.80.0140.00316.84
8.0.70.0000.00716.98
8.0.60.0000.00816.91
8.0.50.0090.00016.96
8.0.30.0100.00916.95
8.0.20.0160.00317.40
8.0.10.0040.00417.03
8.0.00.0080.00916.80
7.4.330.0000.00514.66
7.4.320.0030.00316.46
7.4.300.0030.00316.49
7.4.290.0030.00316.45
7.4.280.0000.00716.54
7.4.270.0030.00316.39
7.4.260.0030.00313.11
7.4.250.0080.00016.48
7.4.240.0000.00716.57
7.4.230.0040.00416.59
7.4.220.0090.00616.59
7.4.210.0100.00416.60
7.4.200.0050.00216.60
7.4.190.0030.00516.63
7.4.160.0030.01416.42
7.4.150.0070.01017.40
7.4.140.0130.00817.86
7.4.130.0110.00616.50
7.4.120.0130.00516.52
7.4.110.0070.01016.41
7.4.100.0090.00916.57
7.4.90.0100.00916.36
7.4.80.0140.00419.39
7.4.70.0130.00316.32
7.4.60.0120.01216.36
7.4.50.0060.00316.45
7.4.40.0080.00622.77
7.4.30.0120.00616.51
7.4.00.0040.01115.09
7.3.330.0060.00013.34
7.3.320.0000.00513.32
7.3.310.0050.00216.41
7.3.300.0070.00016.39
7.3.290.0070.01116.38
7.3.280.0100.00616.36
7.3.270.0130.01017.40
7.3.260.0080.01118.24
7.3.250.0090.01116.35
7.3.240.0040.01316.62
7.3.230.0140.01116.71
7.3.210.0090.00916.35
7.3.200.0070.01319.39
7.3.190.0170.00616.44
7.3.180.0090.00616.34
7.3.170.0040.01916.59
7.3.160.0110.01116.32
7.3.120.0090.00614.74
7.2.330.0080.00816.59
7.2.320.0140.01016.69
7.2.310.0070.01416.58
7.2.300.0060.01216.59
7.2.290.0030.01316.57
7.2.60.0070.00716.59
7.2.00.0100.00319.29
7.1.200.0060.00615.64
7.1.100.0070.00717.84
7.1.70.0040.00417.09
7.1.60.0090.01319.40
7.1.50.0110.01416.85
7.1.00.0000.04022.29
7.0.200.0030.00316.78
7.0.140.0000.07722.07
7.0.70.0030.03721.73
7.0.60.0030.06021.73
7.0.50.0070.07722.19
7.0.40.0030.09320.08
7.0.30.0000.08720.03
7.0.20.0030.07020.13
7.0.10.0070.07720.05
7.0.00.0000.06319.99
5.6.280.0000.07720.91
5.6.220.0070.07320.66
5.6.210.0030.08020.68
5.6.200.0100.07721.05
5.6.190.0130.08021.14
5.6.180.0070.07721.15
5.6.170.0070.07721.03
5.6.160.0000.08721.10
5.6.150.0030.04720.97
5.6.140.0000.04321.12
5.6.130.0030.04021.14
5.6.120.0030.04020.96
5.6.110.0000.04321.06
5.6.100.0030.04021.11
5.6.90.0000.04021.16
5.6.80.0070.03020.47
5.6.70.0000.04020.52
5.6.60.0030.03720.32
5.6.50.0000.07320.32
5.6.40.0000.06320.45
5.6.30.0000.04020.46
5.6.20.0000.07020.42
5.6.10.0000.04320.32
5.6.00.0030.03320.41
5.5.360.0030.04020.51
5.5.350.0030.08320.46
5.5.340.0000.08720.78
5.5.330.0030.08320.94
5.5.320.0100.08320.90
5.5.310.0000.08720.79
5.5.300.0030.04320.88
5.5.290.0000.04320.90
5.5.280.0100.06020.88
5.5.270.0030.04020.83
5.5.260.0030.04020.76
5.5.250.0030.03720.64
5.5.240.0030.04020.16
5.5.230.0000.04320.20
5.5.220.0070.03320.03
5.5.210.0000.03320.23
5.5.200.0030.05020.26
5.5.190.0000.04720.24
5.5.180.0030.04320.22
5.5.160.0000.04020.28
5.5.150.0030.03720.27
5.5.140.0000.04020.26
5.5.130.0030.03720.15
5.5.120.0070.03320.13
5.5.110.0000.05720.24
5.5.100.0030.03719.99
5.5.90.0000.04720.15
5.5.80.0030.03020.11
5.5.70.0000.04020.08
5.5.60.0070.03719.95
5.5.50.0030.03720.11
5.5.40.0030.04020.10
5.5.30.0030.04020.06
5.5.20.0030.03720.06
5.5.10.0000.04020.14
5.5.00.0030.03720.02
5.4.450.0000.04319.37
5.4.440.0000.04319.20
5.4.430.0030.04319.50
5.4.420.0000.03719.20
5.4.410.0030.04019.25
5.4.400.0000.04319.09
5.4.390.0030.05318.91
5.4.380.0030.03318.85
5.4.370.0070.03018.92
5.4.360.0030.05019.13
5.4.350.0000.04319.05
5.4.340.0000.04019.03
5.4.320.0000.03719.13
5.4.310.0030.04719.18
5.4.300.0030.03319.18
5.4.290.0030.03718.84
5.4.280.0070.03319.18
5.4.270.0030.03719.21
5.4.260.0000.03719.05
5.4.250.0000.03719.14
5.4.240.0070.04718.84
5.4.230.0000.03319.06
5.4.220.0070.05718.89
5.4.210.0030.03319.16
5.4.200.0030.03019.12
5.4.190.0000.03719.02
5.4.180.0030.03719.15
5.4.170.0000.03718.86
5.4.160.0000.03719.21
5.4.150.0000.08319.18
5.4.140.0070.05716.29
5.4.130.0030.06316.34
5.4.120.0000.08016.35
5.4.110.0030.07316.35
5.4.100.0000.07716.48
5.4.90.0030.07316.28
5.4.80.0100.06316.41
5.4.70.0000.08016.37
5.4.60.0030.06716.45
5.4.50.0070.06716.25
5.4.40.0000.05316.50
5.4.30.0030.07016.32
5.4.20.0100.06316.26
5.4.10.0030.07316.40
5.4.00.0000.04315.87
5.3.290.0000.03714.61
5.3.280.0000.03714.59
5.3.270.0000.03714.58
5.3.260.0030.02714.67
5.3.250.0030.02714.64
5.3.240.0070.05314.61
5.3.230.0030.08014.59
5.3.220.0070.06014.54
5.3.210.0000.04714.67
5.3.200.0030.07714.55
5.3.190.0030.07714.67
5.3.180.0100.07014.50
5.3.170.0030.05314.59
5.3.160.0070.05014.68
5.3.150.0000.07714.59
5.3.140.0100.04014.52
5.3.130.0000.07714.52
5.3.120.0070.07314.58
5.3.110.0030.06714.61
5.3.100.0100.07314.02
5.3.90.0000.06014.09
5.3.80.0000.04014.01
5.3.70.0030.05714.13
5.3.60.0030.07313.90
5.3.50.0070.07314.04
5.3.40.0030.06713.86
5.3.30.0030.05014.01
5.3.20.0030.06013.82
5.3.10.0000.07313.73
5.3.00.0100.06713.71
5.2.170.0000.05012.47
5.2.160.0070.06312.47
5.2.150.0000.06312.47
5.2.140.0000.06012.47
5.2.130.0000.03012.47
5.2.120.0000.04312.47
5.2.110.0030.06012.47
5.2.100.0000.06012.47
5.2.90.0030.06312.47
5.2.80.0070.06012.47
5.2.70.0030.05012.47
5.2.60.0000.06312.47
5.2.50.0170.05312.47
5.2.40.0100.06012.47
5.2.30.0000.06712.47
5.2.20.0030.06312.47
5.2.10.0070.05712.47
5.2.00.0030.06012.47
5.1.60.0070.04712.47
5.1.50.0000.05712.47
5.1.40.0000.03712.47
5.1.30.0130.04712.47
5.1.20.0070.05312.47
5.1.10.0070.03712.47
5.1.00.0000.04312.47
5.0.50.0000.04312.47
5.0.40.0030.04312.47
5.0.30.0000.06712.47
5.0.20.0000.04012.47
5.0.10.0030.04312.47
5.0.00.0000.06712.47
4.4.90.0000.03712.47
4.4.80.0030.02712.47
4.4.70.0000.03712.47
4.4.60.0000.03712.47
4.4.50.0000.02712.47
4.4.40.0000.04312.47
4.4.30.0000.02712.47
4.4.20.0000.04012.47
4.4.10.0000.02312.47
4.4.00.0030.05012.47
4.3.110.0000.03712.47
4.3.100.0030.03012.47
4.3.90.0070.02712.47
4.3.80.0000.05712.47
4.3.70.0000.03312.47
4.3.60.0000.03312.47
4.3.50.0000.03012.47
4.3.40.0000.05012.47
4.3.30.0030.02312.47
4.3.20.0030.03712.47
4.3.10.0000.04012.47
4.3.00.0030.03312.47

preferences:
45.82 ms | 401 KiB | 5 Q