3v4l.org

run code in 500+ PHP versions simultaneously
<?php function sum($x) { return new class ($x) { function __construct(private int $x = 0) {} function __invoke($num): static { return new static($num + $this->x); } function __toString(): string { return (string)$this->x; } }; } echo sum(1000)(400)(80)(8)(200)(20)(2);

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.30.0080.00919.41
8.5.20.0090.00820.29
8.5.10.0090.01119.63
8.5.00.0090.01221.70
8.4.180.0130.01122.10
8.4.170.0110.01023.87
8.4.160.0140.00823.93
8.4.150.0070.00616.79
8.4.140.0120.00917.56
8.4.130.0040.00417.79
8.4.120.0100.00920.51
8.4.110.0040.00422.41
8.4.100.0130.00717.77
8.4.90.0080.01018.93
8.4.80.0060.00617.80
8.4.70.0090.00517.90
8.4.60.0150.00718.70
8.4.50.0110.00917.88
8.4.40.0100.01017.60
8.4.30.0060.00920.85
8.4.20.0120.00919.57
8.4.10.0110.01119.48
8.3.300.0130.00622.91
8.3.290.0120.00920.94
8.3.280.0110.00918.44
8.3.270.0110.00816.66
8.3.260.0050.00416.68
8.3.250.0090.00718.91
8.3.240.0120.00816.43
8.3.230.0070.00316.83
8.3.220.0060.00417.19
8.3.210.0070.00716.62
8.3.200.0040.00416.63
8.3.190.0110.00717.45
8.3.180.0060.01316.60
8.3.170.0030.01217.43
8.3.160.0150.00318.47
8.3.150.0110.00417.31
8.3.140.0090.00916.63
8.3.130.0090.00016.65
8.3.120.0090.00020.62
8.3.110.0260.02015.92
8.3.100.0260.01116.65
8.3.90.0260.00016.35
8.3.80.0120.01216.25
8.3.70.0230.00016.63
8.3.60.0280.00316.22
8.3.50.0330.00316.00
8.3.40.0270.01217.48
8.3.30.0330.00717.50
8.3.20.0460.00417.25
8.3.10.0320.01017.25
8.3.00.0140.00717.13
8.2.300.0120.00822.04
8.2.290.0140.00520.63
8.2.280.0040.00418.30
8.2.270.0070.01117.00
8.2.260.0110.00416.58
8.2.250.0060.00318.65
8.2.240.0150.00417.27
8.2.230.0160.00416.38
8.2.220.0200.00716.32
8.2.210.0220.00016.50
8.2.200.0240.01716.38
8.2.190.0290.00616.25
8.2.180.0330.00316.53
8.2.170.0370.00717.75
8.2.160.0350.01017.49
8.2.150.0380.00617.50
8.2.140.0370.00617.63
8.2.130.0380.00617.38
8.2.120.0390.00617.25
8.2.110.0530.00717.63
8.2.100.0350.00817.50
8.2.90.0260.01617.37
8.2.80.0370.00617.50
8.2.70.0330.01017.50
8.2.60.0330.00917.50
8.2.50.0370.00617.50
8.2.40.0280.00917.59
8.2.30.0300.00717.38
8.2.20.0310.00317.38
8.2.10.0270.00617.50
8.2.00.0240.00917.46
8.1.340.0110.00917.67
8.1.330.0110.00720.60
8.1.320.0120.00716.13
8.1.310.0040.01416.20
8.1.300.0040.00418.70
8.1.290.0320.00715.98
8.1.280.0350.00615.99
8.1.270.0200.01717.40
8.1.260.0260.01617.13
8.1.250.0330.00717.13
8.1.240.0330.00717.25
8.1.230.0310.00016.98
8.1.220.0320.00617.23
8.1.210.0340.00617.13
8.1.200.0360.00517.13
8.1.190.0310.00916.97
8.1.180.0340.00417.13
8.1.170.0210.01217.13
8.1.160.0240.01417.10
8.1.150.0330.00717.09
8.1.140.0260.01517.13
8.1.130.0220.01817.22
8.1.120.0270.00917.10
8.1.110.0340.00316.98
8.1.100.0140.00317.24
8.1.90.0120.00617.38
8.1.80.0170.00017.34
8.1.70.0160.00317.35
8.1.60.0150.00517.50
8.1.50.0290.01417.23
8.1.40.0300.01217.23
8.1.30.0390.00417.50
8.1.20.0400.00617.34
8.1.10.0310.01417.23
8.1.00.0380.00717.38

preferences:
43.2 ms | 970 KiB | 5 Q