3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Command { private $photoIds; private $categoryIds; private function setPhotoIds(int ...$photoIds):self { $this->photoIds = $photoIds; return $this; } private function setCategoryIds(int ...$categoryIds):self { $this->categoryIds = $categoryIds; return $this; } public function __construct(array $photoIds, array $categoryIds) { $this ->setPhotoIds(...$photoIds) ->setCategoryIds(...$categoryIds); } public function getPhotoIds():array { return $this->photoIds; } public function getCategoryIds():array { return $this->categoryIds; } } class Handler { public function __invoke(Command $command) { return array_sum($command->getPhotoIds() + $command->getCategoryIds()); } } $handler = new Handler(); $command = new Command([1, 2], [3, 4]); echo $handler($command);

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.40.0040.01118.97
8.3.30.0040.01118.97
8.3.20.0140.00319.91
8.3.10.0080.00023.36
8.3.00.0070.00021.79
8.2.170.0090.00622.96
8.2.160.0070.00720.21
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0000.00821.03
8.2.120.0040.00426.35
8.2.110.0070.00320.94
8.2.100.0120.00017.92
8.2.90.0000.00819.17
8.2.80.0090.00017.97
8.2.70.0030.00617.72
8.2.60.0000.00818.03
8.2.50.0060.00318.09
8.2.40.0040.00422.18
8.2.30.0040.00419.32
8.2.20.0070.00017.74
8.2.10.0050.00217.92
8.2.00.0000.00817.91
8.1.270.0090.00922.05
8.1.260.0040.00428.09
8.1.250.0070.00028.09
8.1.240.0060.00322.42
8.1.230.0070.00418.99
8.1.220.0040.00417.74
8.1.210.0030.00518.77
8.1.200.0030.00617.35
8.1.190.0000.00817.22
8.1.180.0000.00818.10
8.1.170.0000.00818.52
8.1.160.0000.00720.75
8.1.150.0080.00020.64
8.1.140.0040.00419.54
8.1.130.0040.00417.52
8.1.120.0040.00417.43
8.1.110.0040.00417.36
8.1.100.0030.00517.30
8.1.90.0000.00717.43
8.1.80.0000.00717.37
8.1.70.0030.00517.39
8.1.60.0000.00817.63
8.1.50.0000.00817.59
8.1.40.0060.00317.50
8.1.30.0080.00017.49
8.1.20.0000.00817.61
8.1.10.0020.00517.46
8.1.00.0000.00717.52
8.0.300.0040.00418.77
8.0.290.0000.00716.75
8.0.280.0030.00318.45
8.0.270.0030.00317.17
8.0.260.0030.00317.30
8.0.250.0030.00517.08
8.0.240.0040.00416.95
8.0.230.0040.00416.97
8.0.220.0000.00716.88
8.0.210.0000.00716.93
8.0.200.0060.00016.94
8.0.190.0070.00016.97
8.0.180.0000.00816.90
8.0.170.0000.00816.85
8.0.160.0000.00716.95
8.0.150.0040.00416.86
8.0.140.0000.00816.89
8.0.130.0000.00513.39
8.0.120.0040.00416.92
8.0.110.0080.00016.80
8.0.100.0000.00816.87
8.0.90.0030.00616.79
8.0.80.0100.00716.89
8.0.70.0040.00416.91
8.0.60.0030.00616.93
8.0.50.0000.00716.96
8.0.30.0140.00517.01
8.0.20.0080.01117.43
8.0.10.0000.00816.96
8.0.00.0100.00816.83
7.4.330.0050.00016.84
7.4.320.0070.00016.47
7.4.300.0080.00016.62
7.4.290.0030.00316.57
7.4.280.0000.00816.61
7.4.270.0020.00516.42
7.4.260.0030.00316.52
7.4.250.0000.00716.59
7.4.240.0050.00216.52
7.4.230.0000.00716.70
7.4.220.0150.00616.64
7.4.210.0110.00716.57
7.4.200.0040.00416.63
7.4.160.0150.00616.25
7.4.150.0090.00917.40
7.4.140.0060.01317.86
7.4.130.0070.00916.60
7.4.120.0100.00716.46
7.4.110.0160.02816.71
7.4.100.0110.00716.53
7.4.90.0030.01316.52
7.4.80.0110.00619.39
7.4.70.0090.01216.61
7.4.60.0140.00316.51
7.4.50.0100.00316.34
7.4.40.0160.00716.18
7.4.30.0120.00616.43
7.4.00.0100.00614.98
7.3.330.0000.00513.22
7.3.320.0030.00313.17
7.3.310.0040.00416.27
7.3.300.0000.00716.33
7.3.290.0000.00716.20
7.3.280.0100.00716.23
7.3.270.0140.00417.40
7.3.260.0090.00916.32
7.3.250.0100.00916.31
7.3.240.0070.00916.33
7.3.230.0100.00716.39
7.3.210.0140.00316.34
7.3.200.0130.01219.39
7.3.190.0100.01216.29
7.3.180.0160.00716.41
7.3.170.0090.01216.55
7.3.160.0100.00716.38
7.3.10.0030.00716.43
7.3.00.0060.00416.42
7.2.330.0140.00316.84
7.2.320.0100.00716.79
7.2.310.0100.00716.41
7.2.300.0080.01116.55
7.2.290.0060.00916.66
7.2.130.0070.00716.98
7.2.120.0050.00716.70
7.2.110.0000.01216.58
7.2.100.0000.01516.57
7.2.90.0030.00616.83
7.2.80.0090.00516.75
7.2.70.0060.00816.55
7.2.60.0050.01016.84
7.2.50.0070.00516.73
7.2.40.0080.00216.70
7.2.30.0050.00616.93
7.2.20.0050.00816.94
7.2.10.0050.00616.69
7.2.00.0050.01017.84
7.1.250.0080.00515.68
7.1.200.0060.00615.71
7.1.100.0040.01118.35
7.1.70.0030.00617.10
7.1.60.0110.01419.40
7.1.50.0030.01716.98
7.1.00.0100.07022.32
7.0.200.0000.01116.40
7.0.60.0300.07321.75
7.0.50.0030.06017.86
7.0.40.0100.04020.40
7.0.30.0230.05320.19
7.0.20.0230.08720.15
7.0.10.0030.07720.34
7.0.00.0070.07320.09
5.6.280.0100.05721.03
5.6.210.0100.07020.71
5.6.200.0070.05318.13
5.6.190.0000.08020.64
5.6.180.0070.08020.46
5.6.170.0230.05720.44
5.6.160.0130.07720.62
5.6.150.0070.08018.16
5.6.140.0030.08018.15
5.6.130.0130.05018.25
5.6.120.0300.03721.13
5.6.110.0070.08321.11
5.6.100.0070.08720.91
5.6.90.0070.06021.00
5.6.80.0070.08020.29
5.5.350.0170.05720.41
5.5.340.0200.06718.00
5.5.330.0070.04320.57
5.5.320.0470.04320.29
5.5.310.0300.06320.35
5.5.300.0030.06317.98
5.5.290.0030.07317.95
5.5.280.0000.04720.78
5.5.270.0070.04320.73
5.5.260.0100.04020.89
5.5.250.0100.07320.46
5.5.240.0200.06320.19

preferences:
45.34 ms | 400 KiB | 5 Q