3v4l.org

run code in 300+ PHP versions simultaneously
<?php function args_to_assoc_array($function, $args) { if (false === strpos($function, '::')) { $reflection = new ReflectionFunction($function); } else { $reflection = new ReflectionMethod(...explode('::', $function)); } $assoc = []; foreach ($reflection->getParameters() as $i => $parameter) { $assoc[$parameter->getName()] = $args[$i]; } return $assoc; } function f($x, $y) { return args_to_assoc_array(__METHOD__, func_get_args()); } class A { function m($z) { return args_to_assoc_array(__METHOD__, func_get_args()); } } var_dump(f(7, 2), (new A)->m(4));

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.00718.55
8.3.50.0120.00620.07
8.3.40.0110.00418.61
8.3.30.0090.00918.63
8.3.20.0040.00421.85
8.3.10.0040.00423.53
8.3.00.0000.00723.52
8.2.180.0080.01116.32
8.2.170.0070.00722.96
8.2.160.0040.01420.18
8.2.150.0050.00324.18
8.2.140.0030.00624.66
8.2.130.0040.00426.16
8.2.120.0040.00421.08
8.2.110.0060.00321.08
8.2.100.0070.00417.72
8.2.90.0050.00317.71
8.2.80.0040.00419.32
8.2.70.0080.00017.75
8.2.60.0060.00318.16
8.2.50.0080.00018.10
8.2.40.0030.00619.30
8.2.30.0040.00419.31
8.2.20.0000.00718.14
8.2.10.0040.00420.51
8.2.00.0050.00319.29
8.1.280.0200.00025.92
8.1.270.0040.00422.19
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0030.00922.12
8.1.230.0110.00020.82
8.1.220.0060.00317.79
8.1.210.0000.00818.77
8.1.200.0080.00017.35
8.1.190.0040.00417.35
8.1.180.0000.00918.10
8.1.170.0060.00318.47
8.1.160.0050.00318.90
8.1.150.0030.00318.84
8.1.140.0050.00322.15
8.1.130.0070.00020.03
8.1.120.0070.00017.36
8.1.110.0070.00017.54
8.1.100.0040.00717.43
8.1.90.0030.00617.49
8.1.80.0030.00517.49
8.1.70.0070.00017.38
8.1.60.0030.00717.61
8.1.50.0040.00417.45
8.1.40.0000.00917.55
8.1.30.0060.00317.63
8.1.20.0060.00317.57
8.1.10.0000.00817.43
8.1.00.0000.00717.47
8.0.300.0070.00019.85
8.0.290.0060.00316.75
8.0.280.0030.00318.34
8.0.270.0030.00316.82
8.0.260.0060.00018.50
8.0.250.0000.00717.02
8.0.240.0070.00016.98
8.0.230.0050.00216.97
8.0.220.0000.00816.78
8.0.210.0030.00316.95
8.0.200.0060.00016.85
8.0.190.0040.00416.96
8.0.180.0000.00716.96
8.0.170.0090.00016.91
8.0.160.0070.00016.91
8.0.150.0040.00416.85
8.0.140.0040.00416.84
8.0.130.0050.00013.34
8.0.120.0040.00416.84
8.0.110.0000.00716.81
8.0.100.0000.00716.80
8.0.90.0040.00416.85
8.0.80.0140.00416.94
8.0.70.0000.00716.90
8.0.60.0000.00716.98
8.0.50.0040.00416.80
8.0.30.0110.00617.10
8.0.20.0090.01217.34
8.0.10.0040.00416.87
8.0.00.0080.01016.79
7.4.330.0020.00216.67
7.4.320.0030.00316.60
7.4.300.0000.00716.60
7.4.290.0070.00016.62
7.4.280.0000.00716.56
7.4.270.0070.00016.47
7.4.260.0000.00716.59
7.4.250.0050.00316.43
7.4.240.0060.00316.55
7.4.230.0070.00016.59
7.4.220.0080.00016.57
7.4.210.0100.00716.59
7.4.200.0000.00716.72
7.4.160.0080.01116.57
7.4.140.0110.00817.86
7.4.130.0110.00716.40
7.4.120.0030.01616.38
7.4.110.0110.00716.81
7.4.100.0150.00316.30
7.4.90.0100.00716.52
7.4.80.0040.01419.39
7.4.70.0030.01316.49
7.4.60.0030.01316.51
7.4.50.0040.00716.51
7.4.40.0060.01316.62
7.4.00.0090.00614.99
7.3.330.0060.00013.41
7.3.320.0000.00713.35
7.3.310.0030.00616.38
7.3.300.0000.00716.27
7.3.290.0000.00716.35
7.3.280.0090.00716.42
7.3.260.0100.00716.48
7.3.240.0080.01216.40
7.3.230.0100.00716.46
7.3.210.0070.01016.67
7.3.200.0150.00416.47
7.3.190.0000.01616.38
7.3.180.0170.00016.58
7.3.170.0180.00416.60
7.3.160.0140.00416.67
7.3.120.0090.00815.02
7.3.110.0090.00814.89
7.3.100.0050.01114.95
7.3.90.0110.00714.69
7.3.80.0090.00314.85
7.3.70.0080.00315.00
7.3.60.0040.00814.89
7.3.50.0070.00514.92
7.3.40.0060.00614.88
7.3.30.0010.01414.87
7.3.20.0060.00716.69
7.3.10.0070.00416.75
7.3.00.0240.00716.14
7.2.330.0100.00716.64
7.2.320.0090.00916.55
7.2.310.0140.00316.46
7.2.300.0130.00316.79
7.2.290.0150.00816.51
7.2.250.0090.00915.17
7.2.240.0070.01115.15
7.2.230.0060.01015.22
7.2.220.0050.01115.04
7.2.210.0060.00915.07
7.2.200.0090.00715.06
7.2.190.0060.00814.94
7.2.180.0040.01015.13
7.2.170.0050.00615.00
7.2.130.1050.00714.76
7.2.120.0460.01314.87
7.2.110.1030.01314.72
7.2.100.0970.00314.73
7.2.90.1120.00714.86
7.2.80.0600.01014.96
7.2.70.0630.00915.21
7.2.60.0860.01015.37
7.2.50.1030.00715.06
7.2.40.0910.00715.10
7.2.30.0930.01015.04
7.2.20.0610.00714.95
7.2.10.0630.00615.12
7.2.00.0540.00615.14
7.1.330.0080.00615.71
7.1.320.0060.00615.83
7.1.310.0090.00715.94
7.1.300.0090.00415.75
7.1.290.0030.00815.85
7.1.280.0050.00815.87
7.1.270.0040.00815.71
7.1.260.0060.00915.67
7.1.250.0450.01014.04
7.0.330.0800.01313.62
5.6.380.0050.01114.72

preferences:
32.87 ms | 400 KiB | 5 Q