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.70.0080.00818.43
8.3.60.0070.01418.68
8.3.50.0100.00721.02
8.3.40.0040.01118.86
8.3.30.0110.00418.83
8.3.20.0070.00020.21
8.3.10.0040.00421.80
8.3.00.0050.00318.16
8.2.190.0040.01116.88
8.2.180.0130.00316.63
8.2.170.0120.00322.96
8.2.160.0040.00920.35
8.2.150.0030.00624.18
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0050.00517.88
8.2.110.0070.00320.57
8.2.100.0060.00617.84
8.2.90.0040.00419.20
8.2.80.0080.00017.97
8.2.70.0050.00317.75
8.2.60.0040.00417.93
8.2.50.0080.00018.07
8.2.40.0000.00719.36
8.2.30.0050.00518.06
8.2.20.0050.00317.64
8.2.10.0000.00718.06
8.2.00.0050.00317.98
8.1.280.0070.00725.92
8.1.270.0100.01022.03
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0060.00322.42
8.1.230.0080.00320.32
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0090.00017.38
8.1.190.0040.00417.36
8.1.180.0000.00718.10
8.1.170.0000.00818.50
8.1.160.0070.00021.95
8.1.150.0050.00218.89
8.1.140.0030.00617.33
8.1.130.0030.00317.71
8.1.120.0050.00217.55
8.1.110.0000.00717.47
8.1.100.0000.00717.49
8.1.90.0040.00417.37
8.1.80.0040.00417.36
8.1.70.0040.00417.46
8.1.60.0080.00017.59
8.1.50.0080.00017.54
8.1.40.0050.00317.48
8.1.30.0040.00417.54
8.1.20.0020.00517.73
8.1.10.0060.00317.63
8.1.00.0040.00417.50
8.0.300.0020.00518.77
8.0.290.0040.00416.75
8.0.280.0000.00718.46
8.0.270.0070.00017.21
8.0.260.0030.00317.18
8.0.250.0040.00416.93
8.0.240.0040.00417.00
8.0.230.0030.00616.92
8.0.220.0000.00716.82
8.0.210.0040.00416.96
8.0.200.0000.00717.07
8.0.190.0000.00817.06
8.0.180.0040.00416.94
8.0.170.0030.00517.01
8.0.160.0040.00416.86
8.0.150.0000.00816.91
8.0.140.0070.00016.73
8.0.130.0000.00513.45
8.0.120.0000.00816.82
8.0.110.0050.00216.96
8.0.100.0050.00317.07
8.0.90.0040.00417.08
8.0.80.0140.00416.94
8.0.70.0050.00216.94
8.0.60.0000.00816.82
8.0.50.0000.00716.94
8.0.30.0110.00617.05
8.0.20.0070.01217.40
8.0.10.0040.00417.09
8.0.00.0110.01016.75
7.4.330.0000.00515.09
7.4.320.0000.00716.59
7.4.300.0030.00316.40
7.4.290.0030.00316.61
7.4.280.0050.00316.45
7.4.270.0070.00016.54
7.4.260.0070.00016.51
7.4.250.0030.00516.46
7.4.240.0050.00216.49
7.4.230.0040.00416.48
7.4.220.0040.01616.52
7.4.210.0050.00916.51
7.4.200.0040.00416.70
7.4.160.0120.00416.48
7.4.150.0160.00317.40
7.4.140.0090.01417.86
7.4.130.0110.00616.54
7.4.120.0090.00816.45
7.4.110.0120.00916.57
7.4.100.0150.00916.60
7.4.90.0080.00816.73
7.4.80.0120.00919.39
7.4.70.0090.01216.44
7.4.60.0130.00316.59
7.4.50.0080.00016.68
7.4.40.0060.01016.43
7.4.30.0070.01516.35
7.4.00.0070.01014.98
7.3.330.0030.00313.20
7.3.320.0000.00613.34
7.3.310.0000.00716.34
7.3.300.0030.00316.30
7.3.290.0030.00316.25
7.3.280.0060.01016.30
7.3.270.0120.00617.40
7.3.260.0140.00316.57
7.3.250.0160.00816.48
7.3.240.0080.01116.40
7.3.230.0140.00416.56
7.3.210.0060.01016.56
7.3.200.0060.01116.51
7.3.190.0040.01216.56
7.3.180.0170.00016.48
7.3.170.0120.00416.40
7.3.160.0040.01716.45
7.3.120.0130.00714.94
7.3.110.0060.01014.79
7.3.100.0080.00614.98
7.3.90.0040.00714.92
7.3.80.0030.01414.66
7.3.70.0000.01114.64
7.3.60.0060.00614.99
7.3.50.0060.00315.02
7.3.40.0080.00814.97
7.3.30.0080.00414.94
7.3.20.0040.01216.64
7.3.10.0110.00616.41
7.3.00.0130.00516.46
7.2.330.0100.00716.65
7.2.320.0060.01016.73
7.2.310.0100.00616.61
7.2.300.0090.00916.62
7.2.290.0080.00816.71
7.2.250.0070.01314.96
7.2.240.0070.01414.66
7.2.230.0000.01514.95
7.2.220.0060.00914.95
7.2.210.0070.00714.92
7.2.200.0030.01014.87
7.2.190.0030.00714.94
7.2.180.0000.01314.98
7.2.170.0000.01315.05
7.2.130.0100.00716.38
7.2.120.0160.00816.28
7.2.110.0060.01016.65
7.2.100.0070.00416.58
7.2.90.0070.01116.63
7.2.80.0080.00616.61
7.2.70.0110.00316.70
7.2.60.0120.00316.67
7.2.50.0030.01016.83
7.2.40.0060.01616.89
7.2.30.0060.00616.62
7.2.20.0040.01216.64
7.2.10.0090.00516.68
7.2.00.0060.00718.13
7.1.330.0080.00415.81
7.1.320.0100.00315.70
7.1.310.0040.01115.97
7.1.300.0000.01515.64
7.1.290.0040.01115.80
7.1.280.0000.01215.67
7.1.270.0070.00715.57
7.1.260.0030.00815.76
7.1.250.0080.01215.38
7.1.200.0050.00515.78
7.1.100.0000.01118.23
7.1.70.0000.00717.22
7.1.60.0080.00319.27
7.1.50.0030.01916.70
7.1.00.0070.07322.54
7.0.200.0000.00916.63
7.0.100.0070.04019.97
7.0.90.0200.04319.89
7.0.80.0070.04320.02
7.0.70.0170.08719.88
7.0.60.0100.08020.01
7.0.50.0170.03720.35
7.0.40.0070.06320.08
7.0.30.0030.04320.14
7.0.20.0000.05320.04
7.0.10.0100.08020.12
7.0.00.0100.07320.14
5.6.280.0000.06320.83
5.6.250.0030.04720.51
5.6.240.0070.07720.68
5.6.230.0030.04320.54
5.6.220.0170.05720.63
5.6.210.0130.07020.57
5.6.200.0000.07321.19
5.6.190.0000.05021.06
5.6.180.0030.05020.95
5.6.170.0070.08321.15
5.6.160.0030.04321.00
5.6.150.0030.04321.03
5.6.140.0000.07021.05
5.6.130.0070.04321.05
5.6.120.0100.03321.03
5.6.110.0070.07721.01
5.6.100.0030.06721.04
5.6.90.0100.08721.07
5.6.80.0070.06320.43
5.6.70.0000.06320.45
5.6.60.0070.03320.42
5.6.50.0070.03720.43
5.6.40.0070.04720.28
5.6.30.0070.03720.43
5.6.20.0070.08020.44
5.6.10.0100.03020.37
5.6.00.0000.08720.36
5.5.380.0070.04020.41
5.5.370.0070.04320.41
5.5.360.0070.07720.57
5.5.350.0030.08320.41
5.5.340.0030.09020.75
5.5.330.0000.03720.89
5.5.320.0070.07720.79
5.5.310.0100.07320.63
5.5.300.0030.04320.82
5.5.290.0100.06320.84
5.5.280.0070.04020.79
5.5.270.0070.04020.87
5.5.260.0070.04720.64
5.5.250.0130.03020.68
5.5.240.0100.03020.31
5.5.230.0070.03720.27
5.5.220.0000.04020.00
5.5.210.0130.07320.27
5.5.200.0130.07320.20
5.5.190.0100.03020.25
5.5.180.0030.07020.14
5.5.160.0100.03719.98
5.5.150.0070.06320.24
5.5.140.0030.04320.00
5.5.130.0000.04320.00
5.5.120.0070.04020.18
5.5.110.0130.04020.22
5.5.100.0030.07020.14
5.5.90.0170.06720.12
5.5.80.0030.06719.98
5.5.70.0130.07320.15
5.5.60.0070.07020.07
5.5.50.0100.04020.15
5.5.40.0070.06019.93
5.5.30.0070.04320.08
5.5.20.0070.06020.03
5.5.10.0070.04020.13
5.5.00.0100.04020.13
5.4.450.0070.07019.42
5.4.440.0000.08319.55
5.4.430.0070.07019.20
5.4.420.0030.04019.37
5.4.410.0030.07319.23
5.4.400.0130.06719.14
5.4.390.0130.07019.04
5.4.380.0070.04318.91
5.4.370.0100.07019.03
5.4.360.0070.07718.92
5.4.350.0030.04319.14
5.4.340.0070.03719.21
5.4.320.0070.06719.03
5.4.310.0000.06719.23
5.4.300.0100.05018.89
5.4.290.0070.05718.95
5.4.280.0130.05319.16
5.4.270.0070.05719.04
5.4.260.0130.05319.13
5.4.250.0070.04319.13
5.4.240.0100.07319.18
5.4.230.0070.06319.08
5.4.220.0070.06719.13
5.4.210.0030.04019.20
5.4.200.0030.06319.02
5.4.190.0070.05719.19
5.4.180.0070.05319.20
5.4.170.0030.05019.13
5.4.160.0070.05319.11
5.4.150.0130.07319.12
5.4.140.0070.05716.25
5.4.130.0030.05016.24
5.4.120.0030.03316.50
5.4.110.0000.04316.54
5.4.100.0030.07716.39
5.4.90.0000.03716.48
5.4.80.0030.03716.33
5.4.70.0070.06316.32
5.4.60.0070.04316.46
5.4.50.0030.04016.46
5.4.40.0070.07716.46
5.4.30.0030.03716.49
5.4.20.0100.03716.46
5.4.10.0030.03716.48
5.4.00.0030.04015.83

preferences:
60.31 ms | 401 KiB | 5 Q