3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Command { private $photoIds; private $categoryIds; private function setPhotoIds(int ...$photoIds):self { return $this->photoIds = $photoIds; } private function setCategoryIds(int ...$categoryIds):self { return $this->categoryIds = $categoryIds; } 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.60.0130.00916.88
8.3.50.0090.01221.27
8.3.40.0070.00718.62
8.3.30.0080.00818.84
8.3.20.0040.00420.13
8.3.10.0080.00023.52
8.3.00.0050.00321.55
8.2.180.0090.00616.50
8.2.170.0090.00922.96
8.2.160.0100.00320.36
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0040.00421.18
8.2.120.0080.00026.35
8.2.110.0030.00621.13
8.2.100.0030.00917.80
8.2.90.0000.00819.09
8.2.80.0040.00417.97
8.2.70.0090.00017.50
8.2.60.0080.00018.04
8.2.50.0060.00318.09
8.2.40.0000.00822.37
8.2.30.0040.00419.31
8.2.20.0060.00319.49
8.2.10.0000.00818.05
8.2.00.0050.00217.88
8.1.280.0070.00725.92
8.1.270.0030.00522.05
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0030.00622.39
8.1.230.0040.00719.16
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0050.00317.23
8.1.180.0050.00318.10
8.1.170.0050.00318.63
8.1.160.0000.00720.71
8.1.150.0040.00420.60
8.1.140.0030.00619.49
8.1.130.0030.00317.57
8.1.120.0070.00017.33
8.1.110.0050.00317.30
8.1.100.0030.00517.43
8.1.90.0040.00417.38
8.1.80.0040.00417.41
8.1.70.0040.00417.30
8.1.60.0040.00417.52
8.1.50.0030.00617.55
8.1.40.0070.00417.55
8.1.30.0090.00017.52
8.1.20.0000.00717.64
8.1.10.0000.00717.64
8.1.00.0040.00417.38
8.0.300.0040.00418.77
8.0.290.0070.00016.75
8.0.280.0050.00218.38
8.0.270.0030.00317.08
8.0.260.0030.00317.05
8.0.250.0030.00316.99
8.0.240.0040.00416.83
8.0.230.0000.00716.84
8.0.220.0000.00716.86
8.0.210.0050.00316.84
8.0.200.0000.00716.95
8.0.190.0060.00316.97
8.0.180.0000.00716.76
8.0.170.0040.00416.85
8.0.160.0000.00716.89
8.0.150.0030.00316.71
8.0.140.0000.00816.91
8.0.130.0000.00613.37
8.0.120.0030.00516.87
8.0.110.0070.00016.84
8.0.100.0040.00416.71
8.0.90.0000.00816.74
8.0.80.0040.01116.86
8.0.70.0040.00416.74
8.0.60.0040.00416.86
8.0.50.0050.00216.78
8.0.30.0060.01416.88
8.0.20.0090.01017.40
8.0.10.0040.00417.01
8.0.00.0100.00616.75
7.4.330.0020.00216.82
7.4.320.0060.00016.55
7.4.300.0050.00316.60
7.4.290.0080.00016.63
7.4.280.0070.00016.57
7.4.270.0000.00716.55
7.4.260.0070.00016.50
7.4.250.0000.00816.59
7.4.240.0030.00516.55
7.4.230.0050.00216.57
7.4.220.0060.01216.56
7.4.210.0110.00516.53
7.4.200.0070.00016.60
7.4.160.0070.01316.48
7.4.150.0200.00517.40
7.4.140.0160.00517.86
7.4.130.0120.00516.50
7.4.120.0130.00616.59
7.4.110.0070.01016.64
7.4.100.0060.01216.41
7.4.90.0110.00616.57
7.4.80.0170.00019.39
7.4.70.0060.01016.72
7.4.60.0150.00316.57
7.4.50.0040.01116.67
7.4.40.0100.00616.54
7.4.30.0100.01316.61
7.4.00.0100.00615.05
7.3.330.0070.00013.34
7.3.320.0030.00313.38
7.3.310.0000.00716.49
7.3.300.0030.00316.29
7.3.290.0000.00616.26
7.3.280.0080.00916.37
7.3.270.0070.01017.40
7.3.260.0080.00816.46
7.3.250.0090.00916.42
7.3.240.0130.00616.38
7.3.230.0090.00916.39
7.3.210.0140.00316.30
7.3.200.0080.00919.39
7.3.190.0100.01316.43
7.3.180.0120.00616.46
7.3.170.0090.00916.41
7.3.160.0180.00016.46
7.2.330.0070.01016.66
7.2.320.0100.00716.67
7.2.310.0060.01216.37
7.2.300.0100.00716.68
7.2.290.0100.00616.59
7.2.60.0040.01116.90
7.2.00.0060.00619.48
7.1.200.0070.00415.57
7.1.100.0040.01218.21
7.1.70.0060.00917.16
7.1.60.0060.01819.40
7.1.50.0040.00816.98
7.1.00.0100.06722.39
7.0.200.0040.00716.85
7.0.60.0230.07021.84
7.0.50.0030.09017.86
7.0.40.0100.08320.40
7.0.30.0300.03320.26
7.0.20.0330.07720.30
7.0.10.0100.05020.34
7.0.00.0030.09320.34
5.6.280.0000.06720.89
5.6.210.0070.03720.61
5.6.200.0030.04718.20
5.6.190.0100.07720.77
5.6.180.0070.07020.68
5.6.170.0200.08720.56
5.6.160.0130.07720.46
5.6.150.0100.07718.29
5.6.140.0100.05018.15
5.6.130.0100.07718.14
5.6.120.0100.07721.02
5.6.110.0070.04321.12
5.6.100.0070.07321.11
5.6.90.0070.09320.97
5.6.80.0130.06720.44
5.5.350.0170.05320.35
5.5.340.0030.08317.95
5.5.330.0100.04020.57
5.5.320.0230.04720.31
5.5.310.0270.05720.19
5.5.300.0000.04717.96
5.5.290.0100.08317.98
5.5.280.0000.04720.77
5.5.270.0100.05320.73
5.5.260.0100.05320.96
5.5.250.0070.06320.70
5.5.240.0230.05720.37

preferences:
33.21 ms | 401 KiB | 5 Q