3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test(callable $fn){ $curried = function(...$currArgs) use(&$fn, &$curried){ $reflection = new ReflectionFunction($fn); $args = count($reflection->getParameters()); if(count($currArgs) == $args){ return $fn(...$currArgs); }else{ return function(...$currArgs2) use( $fn, $currArgs, &$curried){ return $curried(...array_merge($currArgs, $currArgs2)); }; } }; return $curried; } $c = test(fn($x, $y, $z) => $x + $y + $z); echo $c(10)(20,30),"\n"; echo $c(10,20)(30),"\n"; echo $c(10,20,30),"\n";

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.4.20.0040.01819.73
8.4.10.0050.00322.02
8.3.150.0060.01217.27
8.3.140.0040.00420.58
8.3.130.0040.00416.45
8.3.120.0000.01520.91
8.3.110.0040.00716.74
8.3.100.0040.00416.37
8.3.90.0050.00316.52
8.3.80.0060.00317.97
8.3.70.0080.00816.75
8.3.60.0120.00316.63
8.3.50.0120.00616.43
8.3.40.0070.00721.52
8.3.30.0070.00718.78
8.3.20.0080.00024.18
8.3.10.0070.00024.66
8.3.00.0040.00426.16
8.2.270.0190.00018.81
8.2.260.0030.00616.72
8.2.250.0030.00616.87
8.2.240.0030.00619.13
8.2.230.0080.00020.94
8.2.220.0090.00024.06
8.2.210.0040.00426.77
8.2.200.0030.00618.29
8.2.190.0170.00316.63
8.2.180.0030.01216.50
8.2.170.0070.00718.97
8.2.160.0110.00322.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0000.00926.16
8.2.120.0030.00519.36
8.2.110.0090.00019.16
8.2.100.0000.01217.84
8.2.90.0040.00419.23
8.2.80.0030.00519.33
8.2.70.0060.00317.63
8.2.60.0000.00918.09
8.2.50.0040.01617.25
8.2.40.0170.00017.60
8.2.30.0140.00317.38
8.2.20.0180.00017.61
8.2.10.0080.00817.50
8.2.00.0110.00517.37
8.1.310.0030.00518.32
8.1.300.0090.00017.89
8.1.290.0060.00318.88
8.1.280.0140.00025.92
8.1.270.0040.00424.66
8.1.260.0000.00726.35
8.1.250.0060.00328.09
8.1.240.0030.00619.48
8.1.230.0110.00017.83
8.1.220.0030.00617.74
8.1.210.0000.00918.77
8.1.200.0050.00517.38
8.1.190.0090.00917.00
8.1.180.0120.00416.88
8.1.170.0150.00417.00
8.1.160.0120.00617.23
8.1.150.0090.00917.38
8.1.140.0140.00417.10
8.1.130.0060.01217.13
8.1.120.0040.01517.00
8.1.110.0170.00316.88
8.1.100.0120.00617.13
8.1.90.0050.01117.00
8.1.80.0070.01017.22
8.1.70.0000.01717.13
8.1.60.0130.00917.25
8.1.50.0140.00417.13
8.1.40.0120.00617.11
8.1.30.0120.00517.38
8.1.20.0090.00917.25
8.1.10.0110.00617.25
8.1.00.0110.00717.38
8.0.300.0000.00818.84
8.0.290.0040.00416.75
8.0.280.0080.00816.88
8.0.270.0160.00016.52
8.0.260.0030.01316.61
8.0.250.0090.00916.63
8.0.240.0150.00316.52
8.0.230.0060.01216.60
8.0.220.0120.00316.52
8.0.210.0140.00416.52
8.0.200.0100.00716.52
8.0.190.0100.00716.75
8.0.180.0100.00716.75
8.0.170.0160.00016.73
8.0.160.0190.00016.85
8.0.150.0090.00616.74
8.0.140.0100.00716.63
8.0.130.0150.00316.60
8.0.120.0170.00016.52
8.0.110.0080.00816.61
8.0.100.0160.00016.52
8.0.90.0120.00616.52
8.0.80.0100.00516.52
8.0.70.0130.00416.52
8.0.60.0160.00016.63
8.0.50.0040.01316.52
8.0.30.0160.00016.52
8.0.20.0100.00716.59
8.0.10.0130.00416.52

preferences:
36.62 ms | 403 KiB | 5 Q