3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Collection { private $things; public function __construct(Thing ...$things) { $this->things = $things; } public function applyToAll() { /** * This was the function in question */ array_map(function($thing) { $thing->apply(); }, $this->things); } } interface Thing { public function apply(); } class FooThing implements Thing { public function apply() { echo 'applied the way Foo does things.'; } } class BarThing implements Thing { public function apply() { echo 'Bar had something different done to it.'; } } $collection = new Collection(new FooThing, new BarThing); $collection->applyToAll();

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.0060.00918.30
8.3.50.0150.00016.37
8.3.40.0100.00718.85
8.3.30.0090.01318.63
8.3.20.0000.00818.95
8.3.10.0040.00421.77
8.3.00.0080.00021.74
8.2.180.0030.01216.63
8.2.170.0110.00722.96
8.2.160.0110.00318.92
8.2.150.0050.00324.18
8.2.140.0090.00024.66
8.2.130.0080.00026.16
8.2.120.0080.00021.04
8.2.110.0090.00020.56
8.2.100.0040.00817.72
8.2.90.0030.00517.78
8.2.80.0000.00819.11
8.2.70.0000.00817.92
8.2.60.0000.00818.09
8.2.50.0090.00018.10
8.2.40.0030.00519.40
8.2.30.0030.00320.51
8.2.20.0000.00818.14
8.2.10.0030.00518.07
8.2.00.0040.00418.07
8.1.280.0060.00925.92
8.1.270.0080.00022.19
8.1.260.0030.00626.35
8.1.250.0000.00728.09
8.1.240.0030.00722.09
8.1.230.0070.00422.20
8.1.220.0070.00317.74
8.1.210.0040.00419.04
8.1.200.0060.00317.38
8.1.190.0040.00417.36
8.1.180.0040.00418.10
8.1.170.0080.00018.44
8.1.160.0000.00818.96
8.1.150.0040.00418.82
8.1.140.0080.00018.88
8.1.130.0030.00320.30
8.1.120.0020.00517.36
8.1.110.0030.00517.46
8.1.100.0030.00617.45
8.1.90.0040.00417.54
8.1.80.0050.00517.36
8.1.70.0000.00717.51
8.1.60.0050.00317.49
8.1.50.0000.00817.52
8.1.40.0080.00017.55
8.1.30.0040.00417.67
8.1.20.0000.00817.65
8.1.10.0000.00817.49
8.1.00.0050.00317.54
8.0.300.0030.00619.98
8.0.290.0070.00316.63
8.0.280.0000.00718.35
8.0.270.0050.00216.83
8.0.260.0040.00421.88
8.0.250.0080.00017.00
8.0.240.0030.00317.01
8.0.230.0070.00016.99
8.0.220.0030.00316.91
8.0.210.0000.00716.78
8.0.200.0000.00616.95
8.0.190.0050.00316.84
8.0.180.0080.00016.87
8.0.170.0030.00616.90
8.0.160.0000.00816.79
8.0.150.0000.01016.73
8.0.140.0000.00716.89
8.0.130.0030.00313.27
8.0.120.0070.00016.78
8.0.110.0030.00616.92
8.0.100.0050.00316.74
8.0.90.0050.00216.95
8.0.80.0070.01216.83
8.0.70.0050.00316.77
8.0.60.0040.00416.94
8.0.50.0070.00016.71
8.0.30.0150.00717.16
8.0.20.0110.00817.40
8.0.10.0080.00017.01
8.0.00.0140.00316.88
7.4.330.0050.00015.55
7.4.320.0030.00316.61
7.4.300.0000.00716.59
7.4.290.0000.00716.43
7.4.280.0000.00716.52
7.4.270.0000.00716.52
7.4.260.0000.00716.50
7.4.250.0040.00416.59
7.4.240.0000.00716.54
7.4.230.0040.00416.72
7.4.220.0000.00716.41
7.4.210.0100.00916.58
7.4.200.0050.00216.36
7.4.160.0120.00616.51
7.4.140.0070.01217.86
7.4.130.0120.00916.55
7.4.120.0120.00716.50
7.4.110.0130.00316.53
7.4.100.0000.01716.48
7.4.90.0110.00716.64
7.4.80.0090.00919.39
7.4.70.0070.01416.63
7.4.60.0100.01316.45
7.4.50.0140.00316.51
7.4.40.0110.01116.61
7.4.00.0040.01215.11
7.3.330.0020.00213.13
7.3.320.0000.00513.25
7.3.310.0000.00616.30
7.3.300.0000.00616.35
7.3.290.0030.00316.31
7.3.280.0100.00816.29
7.3.260.0090.01016.33
7.3.240.0110.00616.44
7.3.230.0110.00616.25
7.3.210.0030.01316.49
7.3.200.0090.00616.39
7.3.190.0130.00916.64
7.3.180.0200.00016.50
7.3.170.0100.00716.34
7.3.160.0120.00416.38
7.3.10.0070.00716.07
7.3.00.0110.00316.30
7.2.330.0100.01216.78
7.2.320.0150.00316.78
7.2.310.0060.01616.86
7.2.300.0030.01216.57
7.2.290.0030.01416.58
7.2.130.0100.00316.88
7.2.120.0090.00616.39
7.2.110.0150.00416.30
7.2.100.0350.00715.62
7.2.90.0430.00915.57
7.2.80.0130.00615.52
7.2.70.0190.00815.74
7.2.60.0140.00615.82
7.2.50.0110.00315.85
7.2.40.1250.00315.76
7.2.30.0840.00515.78
7.2.20.0100.00615.79
7.2.10.0080.00815.78
7.2.00.0840.00515.80
7.1.250.0130.00315.56
7.1.220.0110.01113.77
7.1.210.0240.00913.92
7.1.200.1230.00313.91
7.1.190.0280.00913.86
7.1.180.0070.00913.55
7.1.170.0970.01313.75
7.1.160.0250.00613.81
7.1.150.1090.00713.85
7.1.140.0220.00613.89
7.1.130.0220.00413.77
7.1.120.0240.00413.82
7.1.110.0130.00314.02
7.1.100.0100.01014.03
7.1.90.0180.00313.78
7.1.80.0150.00313.41
7.1.70.1110.01013.75
7.1.60.0340.00931.59
7.1.50.0410.00331.50
7.1.40.0430.00331.71
7.1.30.0680.01631.90
7.1.20.0410.01031.67
7.1.10.0310.01013.73
7.1.00.1830.01013.45
5.6.380.0080.00714.11

preferences:
56.36 ms | 401 KiB | 5 Q