3v4l.org

run code in 300+ PHP versions simultaneously
<?php function decorate(callable $func): callable { return function (mixed ...$args) use ($func): mixed { echo "Do something before the func call.", PHP_EOL; $result = $func(...$args); echo "Do something after the func call.", PHP_EOL; return $result; }; } // ------------------------------------------------------- $func = function (int $x): void { echo $x, PHP_EOL; }; $func = decorate($func); $func(x: 23);

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.5.10.0090.00819.49
8.5.00.0120.00921.90
8.4.160.0150.01023.92
8.4.150.0020.00114.05
8.4.140.0100.01117.50
8.4.130.0110.00917.52
8.4.120.0110.01020.43
8.4.110.0050.00420.65
8.4.100.0140.00817.80
8.4.90.0140.00620.47
8.4.80.0040.00520.56
8.4.70.0100.00720.48
8.4.60.0070.01420.45
8.4.50.0110.00618.87
8.4.40.0050.00517.49
8.4.30.0060.01223.81
8.4.20.0080.00019.63
8.4.10.0040.00419.22
8.3.290.0110.00820.72
8.3.280.0150.00518.40
8.3.270.0120.00716.59
8.3.260.0140.00516.73
8.3.250.0120.00718.77
8.3.240.0060.00316.50
8.3.230.0140.00516.46
8.3.220.0090.01018.70
8.3.210.0080.00816.56
8.3.200.0040.00416.40
8.3.190.0080.01217.28
8.3.180.0120.00618.81
8.3.170.0130.00616.98
8.3.160.0120.00616.52
8.3.150.0090.00917.09
8.3.140.0000.00717.15
8.3.130.0050.00316.61
8.3.120.0060.00319.14
8.3.110.0380.00616.45
8.3.100.0580.01216.39
8.3.90.0530.00016.27
8.3.80.0290.01816.42
8.3.70.0410.00716.40
8.3.60.0390.00816.56
8.3.50.0380.00716.38
8.3.40.0390.00717.09
8.3.30.0290.01017.16
8.3.20.0380.00417.35
8.3.10.0270.01217.42
8.3.00.0190.00619.30
8.2.300.0130.00718.04
8.2.290.0080.01117.37
8.2.280.0100.01118.43
8.2.270.0130.00616.86
8.2.260.0050.00317.06
8.2.250.0090.00016.66
8.2.240.0060.00317.39
8.2.230.0240.01616.43
8.2.220.0330.00716.16
8.2.210.0320.01316.26
8.2.200.0280.00916.14
8.2.190.0220.00416.37
8.2.180.0320.00716.45
8.2.170.0330.00317.57
8.2.160.0290.00717.65
8.2.150.0260.01117.38
8.2.140.0320.00417.21
8.2.130.0360.01117.52
8.2.120.0310.01117.54
8.2.110.0380.00317.39
8.2.100.0300.00417.37
8.2.90.0330.00717.29
8.2.80.0340.00917.20
8.2.70.0240.00717.35
8.2.60.0330.00417.29
8.2.50.0160.00317.23
8.2.40.0310.00717.70
8.2.30.0180.00817.23
8.2.20.0200.00717.35
8.2.10.0140.00417.41
8.2.00.0110.00717.52
8.1.340.0140.00517.64
8.1.330.0090.01016.32
8.1.320.0140.00518.09
8.1.310.0060.00316.71
8.1.300.0070.00316.76
8.1.290.0200.00316.10
8.1.280.0130.01316.05
8.1.270.0340.00617.00
8.1.260.0300.00817.35
8.1.250.0300.01217.02
8.1.240.0330.00317.23
8.1.230.0440.00317.02
8.1.220.0470.00917.17
8.1.210.0320.00317.28
8.1.200.0200.01216.91
8.1.190.0200.01017.13
8.1.180.0300.00717.07
8.1.170.0250.01317.15
8.1.160.0320.00617.15
8.1.150.0340.00316.90
8.1.140.0240.01417.11
8.1.130.0280.00917.42
8.1.120.0250.01317.27
8.1.110.0330.00416.88
8.1.100.0350.00417.11
8.1.90.0240.01017.20
8.1.80.0210.01517.10
8.1.70.0270.01017.15
8.1.60.0230.01917.30
8.1.50.0200.00717.08
8.1.40.0200.00417.18
8.1.30.0110.00817.35
8.1.20.0200.01317.36
8.1.10.0210.01217.39
8.1.00.0190.00417.18
7.4.330.0270.00916.25

preferences:
73.88 ms | 403 KiB | 5 Q