3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Randoz{ public function between0And10():int { return rand(0,10); } } interface RndCounter { function randomInt():int; function between0And10():int; } function create(): RndCounter { return new class() implements RndCounter { use Randoz; function randomInt():int { return rand(); } }; } $counter = create(); echo $counter->randomInt()." - ".$counter->between0And10();

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.2.40.0040.00417.63
8.2.30.0150.00017.62
8.2.20.0030.00517.63
8.2.10.0080.00817.62
8.2.00.0130.00617.62
8.1.170.0120.00317.62
8.1.160.0040.01217.62
8.1.150.0130.00417.62
8.1.140.0080.00817.62
8.1.130.0110.00417.62
8.1.120.0070.01117.62
8.1.110.0100.00617.62
8.1.100.0050.00717.38
8.1.90.0070.00617.50
8.1.80.0120.00417.50
8.1.70.0100.00717.47
8.1.60.0100.00717.52
8.1.50.0130.00617.49
8.1.40.0150.00417.50
8.1.30.0160.00117.58
8.1.20.0110.00717.57
8.1.10.0120.00517.50
8.1.00.0130.00417.52
8.0.280.0090.00917.62
8.0.270.0160.00317.62
8.0.260.0120.00417.62
8.0.250.0160.00017.62
8.0.240.0170.00017.62
8.0.230.0050.01117.26
8.0.220.0060.00517.16
8.0.210.0110.00217.10
8.0.200.0120.00117.09
8.0.190.0100.00317.11
8.0.180.0070.00617.06
8.0.170.0100.00317.07
8.0.160.0080.00417.00
8.0.150.0110.00217.03
8.0.140.0120.00117.02
8.0.130.0090.00617.07
8.0.120.0100.00417.12
8.0.110.0100.00417.09
8.0.100.0070.00617.06
8.0.90.0110.00217.06
8.0.80.0050.00817.05
8.0.70.0070.00717.06
8.0.60.0090.00417.05
8.0.50.0060.00817.05
8.0.30.0050.00817.05
8.0.20.0040.00817.04
8.0.10.0070.00617.12
7.4.330.0120.00217.62
7.4.320.0100.00717.62
7.4.300.0100.00616.87
7.4.290.0080.00616.82
7.4.280.0090.00616.85
7.4.270.0070.00816.84
7.4.260.0070.00716.83
7.4.250.0100.00716.83
7.4.240.0120.00316.83
7.4.230.0140.00216.84
7.4.220.0100.00316.81
7.4.210.0080.00416.89
7.4.200.0040.00916.83
7.4.190.0100.00516.97
7.4.180.0100.00316.88
7.4.160.0070.00616.91
7.4.150.0100.00416.80
7.4.140.0110.00216.77
7.4.130.0090.00616.80
7.4.120.0120.00216.75
7.4.110.0090.00416.82
7.4.100.0120.00216.82
7.4.90.0100.00416.84
7.4.80.0070.00716.80
7.4.70.0070.00516.76
7.4.60.0070.00516.83
7.4.50.0060.00716.73
7.4.40.0100.00416.74
7.4.30.0100.00416.79
7.4.20.0120.00316.81
7.4.10.0100.00416.84
7.4.00.0060.00716.81

preferences:
39.09 ms | 401 KiB | 5 Q