3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Protocol { public function setProtocolId($id) {return $this;} public function setCreationDate($id) {return $this;} public function setFleet($fleet) { return $this;} } class Fleet {} $data = array('status_date' => 'abc'); if (isset($data['protocol_id'])) { $data = array($data); } $protocols = array(); try { foreach ($data as $_data) { $protocol = new Protocol(); $protocol->setProtocolId($_data['protocol_id']) ->setCreationDate(new \DateTime($_data['creation_date'], new \DateTimeZone('UTC'))); if (!empty($_data['fleet_id'])) { $protocol->setFleet(new Fleet($_data['fleet_id'])); } $protocols[] = $protocol; } } catch (\Exception $e) { throw new \IllegalArgumentException('Error when trying to map result into Protocol object'); }

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.0110.00417.00
8.3.50.0120.00622.16
8.3.40.0110.00418.71
8.3.30.0070.00719.16
8.3.20.0070.00020.31
8.3.10.0080.00023.57
8.3.00.0050.00319.12
8.2.180.0120.00618.66
8.2.170.0120.00622.96
8.2.160.0200.00020.22
8.2.150.0000.00724.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0070.00419.00
8.2.110.0060.00322.30
8.2.100.0060.00618.03
8.2.90.0030.00619.40
8.2.80.0000.00817.97
8.2.70.0030.00617.38
8.2.60.0000.00817.77
8.2.50.0000.00818.07
8.2.40.0030.00718.09
8.2.30.0070.00018.45
8.2.20.0040.00417.70
8.2.10.0000.00718.17
8.2.00.0030.00617.85
8.1.280.0130.00925.92
8.1.270.0040.01123.87
8.1.260.0000.00826.35
8.1.250.0000.00728.09
8.1.240.0030.00622.15
8.1.230.0090.00319.17
8.1.220.0040.00417.74
8.1.210.0050.00318.77
8.1.200.0110.00217.22
8.1.190.0000.00817.25
8.1.180.0000.00818.10
8.1.170.0030.00618.59
8.1.160.0040.00421.89
8.1.150.0040.00418.66
8.1.140.0070.00317.37
8.1.130.0070.00017.75
8.1.120.0000.00817.39
8.1.110.0000.00817.45
8.1.100.0070.00017.46
8.1.90.0040.00417.50
8.1.80.0030.00617.48
8.1.70.0000.00717.35
8.1.60.0040.00417.55
8.1.50.0040.00417.51
8.1.40.0040.00417.50
8.1.30.0040.00817.63
8.1.20.0060.00317.63
8.1.10.0040.00417.46
8.1.00.0060.00317.58
8.0.300.0070.00018.77
8.0.290.0070.00017.05
8.0.280.0030.00518.38
8.0.270.0030.00317.15
8.0.260.0070.00017.27
8.0.250.0030.00316.98
8.0.240.0030.00316.89
8.0.230.0080.00016.96
8.0.220.0070.00016.95
8.0.210.0040.00417.05
8.0.200.0030.00316.98
8.0.190.0040.00417.05
8.0.180.0000.00817.02
8.0.170.0000.00716.98
8.0.160.0070.00017.09
8.0.150.0030.00316.79
8.0.140.0000.00716.95
8.0.130.0050.00013.38
8.0.120.0040.00416.81
8.0.110.0040.00416.96
8.0.100.0040.00416.85
8.0.90.0050.00216.83
8.0.80.0130.00916.90
8.0.70.0000.00816.85
8.0.60.0080.00016.84
8.0.50.0040.00417.00
8.0.30.0160.00317.21
8.0.20.0090.01017.40
8.0.10.0030.00617.13
8.0.00.0110.00717.03
7.4.330.0000.00615.00
7.4.320.0000.00716.55
7.4.300.0000.00716.57
7.4.290.0000.00716.56
7.4.280.0040.00416.47
7.4.270.0000.00716.50
7.4.260.0040.00416.55
7.4.250.0000.00816.68
7.4.240.0060.00216.63
7.4.230.0070.00016.77
7.4.220.0070.01116.61
7.4.210.0090.00516.60
7.4.200.0000.00716.77
7.4.190.0000.00716.82
7.4.160.0120.00316.59
7.4.150.0070.01017.40
7.4.140.0100.00717.86
7.4.130.0110.00616.54
7.4.120.0160.00716.45
7.4.110.0140.00316.69
7.4.100.0100.01016.84
7.4.90.0120.00616.61
7.4.80.0100.00719.39
7.4.70.0130.00316.73
7.4.60.0060.01216.61
7.4.50.0050.00316.70
7.4.40.0120.00916.72
7.4.30.0070.01516.65
7.4.00.0060.01015.05
7.3.330.0000.00613.52
7.3.320.0000.00513.55
7.3.310.0050.00216.37
7.3.300.0000.00716.43
7.3.290.0060.00916.53
7.3.280.0080.00816.54
7.3.270.0140.00417.40
7.3.260.0180.00016.61
7.3.250.0080.00916.69
7.3.240.0150.00516.51
7.3.230.0180.00316.51
7.3.210.0070.01116.53
7.3.200.0060.01119.39
7.3.190.0120.00416.67
7.3.180.0130.00316.59
7.3.170.0130.00716.52
7.3.160.0060.00916.63
7.3.120.0030.01214.75
7.2.330.0130.00316.93
7.2.320.0070.01016.92
7.2.310.0110.01416.71
7.2.300.0140.00316.94
7.2.290.0090.00916.94
7.2.00.0040.01119.60
7.1.100.0080.00018.20
7.1.70.0040.00417.36
7.1.60.0100.01419.46
7.1.50.0070.01635.08
7.1.00.0070.07322.52
7.0.200.0080.00316.92
7.0.140.0070.06321.97
7.0.60.0200.08321.76
7.0.50.0030.04017.89
7.0.40.0070.05720.09
7.0.30.0170.04720.17
7.0.20.0270.07320.21
7.0.10.0100.06320.21
7.0.00.0100.05020.07
5.6.280.0000.07721.16
5.6.210.0030.04320.73
5.6.200.0070.06718.18
5.6.190.0130.03720.68
5.6.180.0200.05020.64
5.6.170.0300.06320.57
5.6.160.0000.09320.58
5.6.150.0170.07018.30
5.6.140.0070.03718.15
5.6.130.0030.09718.28
5.6.120.0130.06320.90
5.6.110.0000.08720.96
5.6.100.0130.07720.98
5.6.90.0100.07720.89
5.6.80.0000.07320.43
5.5.350.0230.03320.33
5.5.340.0030.05018.02
5.5.330.0130.04020.40
5.5.320.0270.04720.25
5.5.310.0230.08020.24
5.5.300.0070.06017.95
5.5.290.0070.07017.94
5.5.280.0130.04320.81
5.5.270.0200.07720.73
5.5.260.0100.06320.88
5.5.250.0170.08020.69
5.5.240.0200.07720.17
5.4.450.3370.05019.29
5.4.440.0070.03719.14
5.4.430.1170.05019.27
5.4.420.3330.04319.13
5.4.410.2900.04319.18
5.4.400.3700.03018.97
5.4.390.4530.03718.86
5.4.380.0170.05719.09
5.4.370.4000.04019.18
5.4.360.3900.04718.98
5.4.350.4270.05019.02
5.4.340.3300.04018.80
5.4.320.3830.03318.80
5.4.310.4230.03019.08
5.4.300.3730.04018.94
5.4.290.4130.03719.08
5.4.280.4000.03319.15
5.4.270.3430.03719.07
5.4.260.3630.03019.09
5.4.250.3870.03318.94
5.4.240.4070.03319.15
5.4.230.3830.03318.84
5.4.220.3800.03719.07
5.4.210.4130.03019.07
5.4.200.3430.03319.09
5.4.190.4270.03318.84
5.4.180.3930.04018.87
5.4.170.4430.03719.14
5.4.160.4030.03719.06
5.4.150.3770.03719.16
5.4.140.4470.04016.41
5.4.130.4170.03016.49
5.4.120.3570.03316.43
5.4.110.3970.03716.27
5.4.100.3800.02716.50
5.4.90.4000.04316.49
5.4.80.3330.03716.49
5.4.70.4070.03316.48
5.4.60.4270.04016.45
5.4.50.3930.03716.45
5.4.40.3430.04316.50
5.4.30.4030.03316.32
5.4.20.4630.03316.41
5.4.10.4230.03316.30
5.4.00.3700.03715.84
5.3.290.4030.03714.68
5.3.280.3730.03714.61
5.3.270.4000.03714.66
5.3.260.4700.03714.61
5.3.250.4530.03014.66
5.3.240.3630.04314.61
5.3.230.3700.03714.66
5.3.220.3800.03314.56
5.3.210.3870.03714.50
5.3.200.3670.03714.60
5.3.190.3600.03714.57
5.3.180.3500.03314.46
5.3.170.3900.04314.64
5.3.160.3930.04314.64
5.3.150.4470.04014.49
5.3.140.4270.04014.50
5.3.130.4500.03714.73
5.3.120.4230.04314.57
5.3.110.4530.03714.56
5.3.100.2970.03314.20
5.3.90.4170.03714.09
5.3.80.3400.04013.95
5.3.70.3630.04314.07
5.3.60.3300.03714.06
5.3.50.2530.02314.00
5.3.40.2930.04013.91
5.3.30.2100.04013.93
5.3.20.1570.03313.85
5.3.10.2270.03013.69
5.3.00.2970.03313.59
5.2.170.1730.02711.23
5.2.160.2230.02311.17
5.2.150.1870.02711.19
5.2.140.1330.03311.16
5.2.130.1030.02711.27
5.2.120.0970.03711.12
5.2.110.1570.02311.15
5.2.100.1530.03011.16
5.2.90.1900.03011.07
5.2.80.2230.02711.00
5.2.70.1670.03311.11
5.2.60.3500.03311.02
5.2.50.1470.03011.17
5.2.40.0900.03010.99
5.2.30.2000.02710.98
5.2.20.2000.03010.86
5.2.10.2500.03010.88
5.2.00.2770.02710.78
5.1.60.2200.02310.05
5.1.50.2630.02710.05
5.1.40.3030.03010.04
5.1.30.2670.02710.23
5.1.20.1930.01710.36
5.1.10.2330.02310.07
5.1.00.2730.02710.05
5.0.50.1530.0278.47
5.0.40.1370.0208.41
5.0.30.0030.0308.26
5.0.20.0070.0408.26
5.0.10.0030.0278.14
5.0.00.0030.0578.20
4.4.90.1230.0175.80
4.4.80.1270.0135.87
4.4.70.1200.0175.81
4.4.60.1600.0075.77
4.4.50.1400.0135.89
4.4.40.1230.0305.79
4.4.30.0830.0205.92
4.4.20.1500.0135.93
4.4.10.1400.0175.91
4.4.00.1230.0275.84
4.3.110.0230.0335.77
4.3.100.0100.0275.69
4.3.90.0070.0305.80
4.3.80.0100.0475.73
4.3.70.0030.0175.75
4.3.60.0030.0175.69
4.3.50.0000.0405.75
4.3.40.0870.0305.67
4.3.30.0900.0235.36
4.3.20.0730.0275.36
4.3.10.0270.0305.36
4.3.00.0570.0175.36

preferences:
41.58 ms | 401 KiB | 5 Q