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.1.100.0040.00717.35
8.1.90.0030.00717.38
8.1.80.0100.00517.44
8.1.70.0100.00717.39
8.1.60.0060.01017.47
8.1.50.0110.00717.42
8.1.40.0130.00717.45
8.1.30.0150.00217.56
8.1.20.0090.00817.55
8.1.10.0130.00317.44
8.1.00.0130.00517.48
8.0.230.0000.01516.91
8.0.220.0000.01116.71
8.0.210.0120.00216.84
8.0.200.0110.00116.83
8.0.190.0090.00416.86
8.0.180.0080.00516.79
8.0.170.0080.00416.80
8.0.160.0100.00216.70
8.0.150.0120.00216.73
8.0.140.0120.00116.73
8.0.130.0070.00716.79
8.0.120.0100.00316.87
8.0.110.0070.00616.82
8.0.100.0090.00516.78
8.0.90.0130.00016.79
8.0.80.0060.00816.77
8.0.70.0080.00616.79
8.0.60.0120.00116.76
8.0.50.0030.00916.77
8.0.30.0040.00916.77
8.0.20.0050.00816.76
8.0.10.0040.00916.87
7.4.300.0090.00616.50
7.4.290.0090.00516.42
7.4.280.0100.00316.46
7.4.270.0050.01016.45
7.4.260.0050.00816.44
7.4.250.0090.00916.44
7.4.240.0110.00316.44
7.4.230.0110.00316.46
7.4.220.0080.00316.41
7.4.210.0050.00616.53
7.4.200.0030.00916.44
7.4.190.0100.00616.64
7.4.180.0090.00216.51
7.4.160.0070.00516.55
7.4.150.0100.00316.39
7.4.140.0090.00316.35
7.4.130.0050.00616.40
7.4.120.0110.00216.31
7.4.110.0050.00716.43
7.4.100.0120.00116.42
7.4.90.0080.00516.46
7.4.80.0080.00616.39
7.4.70.0070.00416.33
7.4.60.0090.00216.43
7.4.50.0040.00816.29
7.4.40.0080.00416.30
7.4.30.0070.00616.38
7.4.20.0130.00216.41
7.4.10.0100.00316.46
7.4.00.0040.00816.41

preferences:
23.4 ms | 406 KiB | 5 Q