3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Wagon { private $name; public function setName($name){ $this->name = $name; } public function getName(){ return $this->name; } } class Train { public function __construct(array $wagons) { $this->wagons = (function (Wagon $wagons) { return $wagons->getName(); })(...$wagons); } } $vagon = new Wagon(); $vagon->setName('vagon 1'); var_dump(new Train([$vagon]));

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.01618.46
8.3.50.0060.00916.59
8.3.40.0040.01118.75
8.3.30.0070.01418.56
8.3.20.0040.00420.32
8.3.10.0050.00321.73
8.3.00.0000.00817.65
8.2.180.0100.01316.88
8.2.170.0150.00722.96
8.2.160.0060.00620.52
8.2.150.0080.00024.18
8.2.140.0050.00224.66
8.2.130.0080.00026.16
8.2.120.0030.00617.75
8.2.110.0030.00622.16
8.2.100.0080.00417.84
8.2.90.0050.00318.16
8.2.80.0000.00918.28
8.2.70.0060.00317.50
8.2.60.0030.00517.50
8.2.50.0070.00317.62
8.2.40.0050.00519.70
8.2.30.0060.00318.06
8.2.20.0050.00217.56
8.2.10.0040.00418.07
8.2.00.0050.00318.05
8.1.280.0070.00725.92
8.1.270.0150.00021.98
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00321.79
8.1.230.0070.00417.83
8.1.220.0030.00517.74
8.1.210.0080.00018.77
8.1.200.0090.00017.35
8.1.190.0040.00817.35
8.1.180.0040.00418.10
8.1.170.0000.00817.62
8.1.160.0000.00722.01
8.1.150.0000.00718.90
8.1.140.0000.00817.46
8.1.130.0070.00017.61
8.1.120.0070.00017.38
8.1.110.0000.00817.39
8.1.100.0000.00717.46
8.1.90.0030.00317.50
8.1.80.0000.00717.45
8.1.70.0040.00417.50
8.1.60.0050.00217.55
8.1.50.0030.00617.59
8.1.40.0000.00917.59
8.1.30.0030.00517.64
8.1.20.0040.00417.58
8.1.10.0030.00617.56
8.1.00.0080.00017.51
8.0.300.0040.00420.03
8.0.290.0000.00716.75
8.0.280.0040.00418.45
8.0.270.0070.00017.30
8.0.260.0030.00317.18
8.0.250.0040.00416.90
8.0.240.0030.00316.95
8.0.230.0030.00716.88
8.0.220.0030.00316.86
8.0.210.0050.00216.83
8.0.200.0030.00316.95
8.0.190.0040.00416.97
8.0.180.0080.00016.87
8.0.170.0030.00516.87
8.0.160.0000.00716.97
8.0.150.0080.00016.82
8.0.140.0000.00716.91
8.0.130.0000.00613.33
8.0.120.0000.00816.80
8.0.110.0020.00516.87
8.0.100.0050.00216.94
8.0.90.0030.00416.77
8.0.80.0040.01116.92
8.0.70.0070.00016.84
8.0.60.0050.00316.84
8.0.50.0070.00016.88
8.0.30.0110.00817.10
8.0.20.0130.00717.40
8.0.10.0000.00816.98
8.0.00.0110.00816.70
7.4.330.0050.00015.08
7.4.320.0030.00316.54
7.4.300.0030.00316.39
7.4.290.0070.00016.60
7.4.280.0040.00416.60
7.4.270.0040.00416.50
7.4.260.0030.00316.48
7.4.250.0000.00816.54
7.4.240.0060.00216.54
7.4.230.0000.00716.41
7.4.220.0080.00916.55
7.4.210.0110.00716.56
7.4.200.0030.00316.60
7.4.160.0030.01316.56
7.4.150.0150.00317.40
7.4.140.0080.01517.86
7.4.130.0120.00516.55
7.4.120.0090.00916.47
7.4.110.0090.01116.65
7.4.100.0150.00916.41
7.4.90.0100.00716.61
7.4.80.0030.01319.39
7.4.70.0090.00916.52
7.4.60.0160.00016.59
7.4.50.0080.00016.56
7.4.40.0100.00616.45
7.4.30.0150.00616.55
7.4.00.0080.01014.93
7.3.330.0020.00213.26
7.3.320.0070.00013.27
7.3.310.0030.00516.20
7.3.300.0040.00416.30
7.3.290.0030.00316.17
7.3.280.0120.00716.28
7.3.270.0100.00617.40
7.3.260.0060.01216.53
7.3.250.0080.00916.47
7.3.240.0120.00916.22
7.3.230.0120.00616.39
7.3.210.0100.00616.39
7.3.200.0080.00816.44
7.3.190.0100.00716.51
7.3.180.0060.01016.49
7.3.170.0130.00316.42
7.3.160.0150.02116.32
7.3.120.0050.01214.77
7.3.110.0040.01214.94
7.3.100.0030.01114.58
7.3.90.0080.00814.76
7.3.80.0060.00814.73
7.3.70.0070.00614.78
7.3.60.0080.00414.72
7.3.50.0120.00214.82
7.3.40.0100.00514.80
7.3.30.0040.00914.67
7.3.20.0070.00516.82
7.3.10.0080.00716.49
7.3.00.0080.00516.55
7.2.330.0030.01516.53
7.2.320.0080.00816.55
7.2.310.0080.00716.62
7.2.300.0130.00316.25
7.2.290.0060.01616.73
7.2.250.0060.01214.83
7.2.240.0100.00915.23
7.2.230.0090.00614.96
7.2.220.0090.00715.16
7.2.210.0030.01515.02
7.2.200.0070.00415.16
7.2.190.0080.00514.92
7.2.180.0110.00314.95
7.2.170.0110.00514.95
7.2.130.0150.00316.54
7.2.120.0120.00816.47
7.2.110.0130.01016.53
7.2.100.0110.00716.92
7.2.90.0060.01216.60
7.2.80.0090.00616.77
7.2.70.0090.01716.70
7.2.60.0080.00616.81
7.2.50.0110.00416.26
7.2.40.0070.00716.73
7.2.30.0100.00016.43
7.2.20.0040.01116.74
7.2.10.0090.01216.86
7.2.00.0030.01018.24
7.1.330.0070.00715.56
7.1.320.0050.00915.79
7.1.310.0030.01115.71
7.1.300.0050.00715.71
7.1.290.0090.00615.53
7.1.280.0050.00715.69
7.1.270.0050.00715.77
7.1.260.0070.00615.80
7.1.250.0110.01115.25
7.1.200.0220.00715.95
7.1.100.0030.01018.27
7.1.70.0030.00517.05
7.1.60.0080.01519.27
7.1.50.0120.00916.89
7.1.00.0030.07722.36
7.0.200.0000.01016.75
7.0.100.0030.08719.98
7.0.90.0000.08719.98
7.0.80.0030.08019.84
7.0.70.0130.07319.90
7.0.60.0030.05319.86
7.0.50.0170.07020.30
7.0.40.0100.07320.15
7.0.30.0070.08020.13
7.0.20.0000.08320.19
7.0.10.0070.06320.14
7.0.00.0130.07720.09
5.6.280.0030.06721.08
5.6.250.0030.07720.61
5.6.240.0130.06020.66
5.6.230.0130.08020.62
5.6.220.0000.07720.48
5.6.210.0100.08720.60
5.6.200.0100.07721.05
5.6.190.0130.07721.06
5.6.180.0130.06721.06
5.6.170.0100.07321.09
5.6.160.0130.07721.06
5.6.150.0130.07721.03
5.6.140.0200.06721.05
5.6.130.0030.07721.06
5.6.120.0130.07321.09
5.6.110.0230.06721.11
5.6.100.0030.08720.94
5.6.90.0070.08320.98
5.6.80.0070.08020.45
5.6.70.0030.07720.45
5.6.60.0170.06020.52
5.6.50.0130.06720.51
5.6.40.0100.08320.51
5.6.30.0170.06720.49
5.6.20.0030.08320.42
5.6.10.0030.08720.45
5.6.00.0100.07020.46
5.5.380.0070.07720.60
5.5.370.0030.06020.59
5.5.360.0030.04320.40
5.5.350.0130.06020.44
5.5.340.0170.05020.94
5.5.330.0070.04720.79
5.5.320.0070.08320.91
5.5.310.0100.07020.81
5.5.300.0130.07720.82
5.5.290.0100.08320.81
5.5.280.0130.08020.80
5.5.270.0030.06020.64
5.5.260.0100.07020.87
5.5.250.0170.07720.75
5.5.240.0100.08020.30
5.5.230.0100.04020.21
5.5.220.0100.08020.12
5.5.210.0000.07020.26
5.5.200.0070.08020.29
5.5.190.0130.07020.26
5.5.180.0030.08720.24
5.5.160.0030.08320.25
5.5.150.0000.08320.16
5.5.140.0070.05320.19
5.5.130.0100.08020.29
5.5.120.0100.07020.16
5.5.110.0030.08320.29
5.5.100.0070.07720.17
5.5.90.0030.05320.09
5.5.80.0070.07720.16
5.5.70.0030.06020.11
5.5.60.0100.07320.14
5.5.50.0070.05320.11
5.5.40.0100.07020.06
5.5.30.0000.08020.07
5.5.20.0200.04720.16
5.5.10.0130.08020.14
5.5.00.0100.07720.09
5.4.450.0030.07719.18
5.4.440.0100.04719.46
5.4.430.0100.07319.56
5.4.420.0100.07719.56
5.4.410.0070.07719.23
5.4.400.0000.07319.04
5.4.390.0000.08318.88
5.4.380.0130.07019.05
5.4.370.0100.07719.08
5.4.360.0100.04319.05
5.4.350.0100.07318.95
5.4.340.0030.08018.88
5.4.320.0070.06018.95
5.4.310.0000.08018.93
5.4.300.0100.06719.03
5.4.290.0170.07019.04
5.4.280.0070.07718.86
5.4.270.0070.08019.18
5.4.260.0030.08019.04
5.4.250.0000.08319.04
5.4.240.0070.07319.03
5.4.230.0030.08019.09
5.4.220.0130.06719.23
5.4.210.0100.07718.94
5.4.200.0030.07719.03
5.4.190.0000.05719.04
5.4.180.0100.05018.94
5.4.170.0100.07319.24
5.4.160.0030.07719.02
5.4.150.0070.07719.11
5.4.140.0200.06716.46
5.4.130.0030.07016.55
5.4.120.0030.07016.48
5.4.110.0130.06716.42
5.4.100.0070.07016.45
5.4.90.0100.06316.40
5.4.80.0070.04716.55
5.4.70.0030.05016.55
5.4.60.0030.06716.50
5.4.50.0130.04316.44
5.4.40.0030.07316.38
5.4.30.0000.05316.25
5.4.20.0070.06716.44
5.4.10.0070.07016.35
5.4.00.0100.05315.89

preferences:
61.45 ms | 400 KiB | 5 Q