3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Connection { public $server, $username, $password, $db; public function __construct($server, $username, $password, $db) { $this->server = $server; $this->username = $username; $this->password = $password; $this->db = $db; } public function __sleep() { return array('server', 'username', 'password', 'db'); } public function __wakeup() { return implode(',',array( $this->server = $server,$this->username = $username, $this->password = $password, $this->db = $db)); } public function a(){ echo $this->server; echo $this->username; echo $this->password; echo $this->db; } } /*$server="server1"; $username="username1"; $password="password1"; $db="db1";*/ $conect= new Connection("server1", "username1", "password1", "db1"); $conect->a(); echo $conect->__wakeup(); ?>

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.70.0040.01118.18
8.3.60.0090.00618.81
8.3.50.0100.00821.97
8.3.40.0140.00719.01
8.3.30.0100.00318.83
8.3.20.0050.00318.89
8.3.10.0040.00421.09
8.3.00.0070.00319.00
8.2.180.0110.00416.72
8.2.170.0000.01522.96
8.2.160.0080.00520.35
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0030.00626.16
8.2.120.0060.00321.11
8.2.110.0070.00421.87
8.2.100.0080.00418.03
8.2.90.0040.00419.17
8.2.80.0040.00417.97
8.2.70.0050.00517.61
8.2.60.0030.00518.05
8.2.50.0030.00618.07
8.2.40.0040.00418.06
8.2.30.0000.00821.10
8.2.20.0030.00517.75
8.2.10.0000.00717.83
8.2.00.0040.00417.77
8.1.280.0150.00025.92
8.1.270.0080.00023.99
8.1.260.0040.00426.35
8.1.250.0060.00328.09
8.1.240.0000.00822.42
8.1.230.0080.00417.77
8.1.220.0000.00818.77
8.1.210.0030.00618.90
8.1.200.0030.00717.38
8.1.190.0040.00417.64
8.1.180.0030.00618.10
8.1.170.0040.00418.66
8.1.160.0050.00218.92
8.1.150.0000.00818.66
8.1.140.0070.00017.41
8.1.130.0000.00717.81
8.1.120.0030.00417.48
8.1.110.0000.00817.38
8.1.100.0040.00417.47
8.1.90.0000.00817.42
8.1.80.0000.00817.49
8.1.70.0000.00717.46
8.1.60.0000.00817.60
8.1.50.0040.00417.46
8.1.40.0060.00317.43
8.1.30.0040.00417.66
8.1.20.0000.00817.62
8.1.10.0070.00317.64
8.1.00.0050.00317.55
8.0.300.0000.00720.07
8.0.290.0000.00817.18
8.0.280.0080.00018.52
8.0.270.0020.00517.29
8.0.260.0030.00316.91
8.0.250.0070.00017.06
8.0.240.0000.00816.96
8.0.230.0070.00017.08
8.0.220.0030.00316.97
8.0.210.0000.00716.91
8.0.200.0000.00717.03
8.0.190.0000.00817.05
8.0.180.0000.00717.04
8.0.170.0030.00617.06
8.0.160.0040.00416.97
8.0.150.0080.00016.95
8.0.140.0040.00316.77
8.0.130.0030.00313.41
8.0.120.0030.00516.84
8.0.110.0000.00816.84
8.0.100.0030.00516.83
8.0.90.0040.00416.87
8.0.80.0060.00916.93
8.0.70.0050.00316.96
8.0.60.0000.00716.84
8.0.50.0040.00416.92
8.0.30.0110.00916.90
8.0.20.0110.01217.45
8.0.10.0000.00717.06
8.0.00.0130.00516.90
7.4.330.0050.00016.82
7.4.320.0030.00316.39
7.4.300.0000.00616.63
7.4.290.0030.00316.64
7.4.280.0030.00316.63
7.4.270.0030.00316.55
7.4.260.0000.00513.30
7.4.250.0030.00316.42
7.4.240.0030.00316.64
7.4.230.0040.00416.53
7.4.220.0060.01316.50
7.4.210.0070.01216.57
7.4.200.0070.00016.49
7.4.190.0030.00316.34
7.4.160.0030.01316.67
7.4.150.0040.01317.40
7.4.140.0120.00517.86
7.4.130.0100.00716.65
7.4.120.0090.01016.55
7.4.110.0100.00716.46
7.4.100.0030.01916.50
7.4.90.0070.01116.61
7.4.80.0080.00819.39
7.4.70.0070.01016.50
7.4.60.0130.00316.61
7.4.50.0030.00516.56
7.4.40.0090.00922.77
7.4.30.0030.01416.64
7.4.00.0060.00914.77
7.3.330.0000.00613.44
7.3.320.0030.00313.46
7.3.310.0000.00716.48
7.3.300.0030.00316.32
7.3.290.0000.01416.38
7.3.280.0130.00516.36
7.3.270.0030.01617.40
7.3.260.0110.01018.24
7.3.250.0100.00716.45
7.3.240.0000.01616.57
7.3.230.0140.00316.59
7.3.210.0100.00616.46
7.3.200.0120.00619.39
7.3.190.0180.00416.46
7.3.180.0030.01516.35
7.3.170.0090.01216.32
7.3.160.0080.00816.58
7.3.120.0070.01014.84
7.2.330.0120.00616.69
7.2.320.0110.00616.38
7.2.310.0070.01616.56
7.2.300.0130.00916.46
7.2.290.0040.01516.66
7.2.00.0070.01019.40
7.1.100.0090.00317.83
7.1.70.0080.00016.89
7.1.60.0070.01719.24
7.1.50.0210.01734.44
7.1.00.0030.05722.41
7.0.200.0040.00416.88
7.0.140.0070.06721.93
7.0.60.0100.06019.96
7.0.50.0070.07317.88
7.0.40.0100.07720.40
7.0.30.0200.04320.07
7.0.20.0330.07320.19
7.0.10.0130.05020.08
7.0.00.0070.04020.26
5.6.280.0100.06720.78
5.6.210.0030.06020.77
5.6.200.0070.08018.29
5.6.190.0000.05020.39
5.6.180.0300.06020.67
5.6.170.0170.06020.47
5.6.160.0100.08320.49
5.6.150.0000.04318.18
5.6.140.0000.04018.14
5.6.130.0130.05018.12
5.6.120.0070.08321.15
5.6.110.0130.08021.02
5.6.100.0100.07720.96
5.6.90.0030.04321.11
5.6.80.0100.07720.29
5.6.70.0230.08320.42
5.5.350.0070.06020.31
5.5.340.0100.04717.93
5.5.330.0070.08320.13
5.5.320.0170.04320.36
5.5.310.0370.07020.17
5.5.300.0070.08017.97
5.5.290.0130.07317.92
5.5.280.0000.04320.81
5.5.270.0130.07020.80
5.5.260.0070.08720.68
5.5.250.0070.07320.70
5.5.240.0030.08020.19
5.4.450.0200.04319.64
5.4.440.0230.07719.67
5.4.430.0300.03319.41
5.4.420.0230.05319.48
5.4.410.0270.07319.42
5.4.400.0230.06719.23
5.4.390.0200.07018.99
5.4.380.0170.04318.86
5.4.370.0200.06019.08
5.4.360.0230.07318.87
5.4.350.0270.06319.09
5.4.340.0370.06319.09
5.4.320.0170.05018.95
5.4.310.0270.07319.16
5.4.300.0200.05719.04
5.4.290.0300.07019.24
5.4.280.0170.06019.09
5.4.270.0270.05019.08
5.4.260.0270.05319.16
5.4.250.0270.05318.84
5.4.240.0300.06718.99
5.4.230.0230.03718.99
5.4.220.0200.03719.09
5.4.210.0330.06318.84
5.4.200.0330.05319.19
5.4.190.0300.04018.98
5.4.180.0200.03719.08
5.4.170.0230.06319.19
5.4.160.0230.04719.11
5.4.150.0300.05019.29
5.4.140.0230.04016.36
5.4.130.0230.07316.66
5.4.120.0270.04716.50
5.4.110.0200.05716.45
5.4.100.0100.06016.51
5.4.90.0230.06016.40
5.4.80.0200.07016.54
5.4.70.0170.04316.35
5.4.60.0270.06316.53
5.4.50.0170.04716.32
5.4.40.0300.05716.57
5.4.30.0300.06316.32
5.4.20.0130.05016.34
5.4.10.0230.06716.24
5.4.00.0270.06715.91
5.3.290.0370.05314.79
5.3.280.0270.05714.69
5.3.270.0300.06314.60
5.3.260.0230.07314.73
5.3.250.0170.08014.69
5.3.240.0300.06314.68
5.3.230.0270.06714.63
5.3.220.0130.07714.57
5.3.210.0270.04014.55
5.3.200.0270.06314.55
5.3.190.0200.08014.66
5.3.180.0170.07714.65
5.3.170.0170.08014.50
5.3.160.0230.06014.59
5.3.150.0170.05314.58
5.3.140.0230.04314.54
5.3.130.0200.06714.48
5.3.120.0230.04714.46
5.3.110.0170.07014.64
5.3.100.0200.07014.20
5.3.90.0330.06714.02
5.3.80.0370.05714.04
5.3.70.0230.07013.94
5.3.60.0130.05314.12
5.3.50.0200.07314.01
5.3.40.0170.04714.18
5.3.30.0230.07314.08
5.3.20.0230.06013.86
5.3.10.0270.06013.75
5.3.00.0300.05313.56
5.2.170.0300.05012.18
5.2.160.0270.05012.18
5.2.150.0300.05312.18
5.2.140.0170.05712.18
5.2.130.0200.03312.18
5.2.120.0270.05012.18
5.2.110.0270.03712.18
5.2.100.0230.04712.18
5.2.90.0200.05012.18
5.2.80.0130.06712.18
5.2.70.0200.05712.18
5.2.60.0170.04712.18
5.2.50.0270.04312.18
5.2.40.0330.02012.18
5.2.30.0170.04712.18
5.2.20.0170.03312.18
5.2.10.0130.02712.18
5.2.00.0130.03012.18
5.1.60.0130.02012.18
5.1.50.0130.02312.18
5.1.40.0030.03012.18
5.1.30.0070.03312.18
5.1.20.0100.03012.18
5.1.10.0130.02312.18
5.1.00.0100.02312.18
5.0.50.0030.02012.18
5.0.40.0030.02012.18
5.0.30.0070.02712.18
5.0.20.0030.02012.18
5.0.10.0030.02012.18
5.0.00.0100.02712.18
4.4.90.0100.03312.18
4.4.80.0130.03012.18
4.4.70.0130.01312.18
4.4.60.0070.01712.18
4.4.50.0100.01312.18
4.4.40.0070.02712.18
4.4.30.0030.01712.18
4.4.20.0100.01012.18
4.4.10.0070.01712.18
4.4.00.0000.02712.18
4.3.110.0070.01712.18
4.3.100.0030.01312.18
4.3.90.0070.01712.18
4.3.80.0030.02312.18
4.3.70.0030.01712.18
4.3.60.0070.01712.18
4.3.50.0070.01312.18
4.3.40.0030.04312.18
4.3.30.0030.01712.18
4.3.20.0030.01312.18
4.3.10.0030.01712.18
4.3.00.0000.01712.18

preferences:
53.51 ms | 401 KiB | 5 Q