3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait T { private static ? int $in = null; public static function in() : int { if (empty(self::$in)) { self::$in = rand(0,10); } return self::$in; } } class A { use T; } class B { use T; } var_dump(A::in(), B::in());

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.60.0360.01117.77
8.4.50.0370.00917.67
8.4.40.0390.01017.71
8.4.30.0380.01117.32
8.4.20.0470.00517.54
8.4.10.0380.00717.49
8.3.200.0330.01316.48
8.3.190.0320.01116.64
8.3.180.0430.00616.28
8.3.170.0370.01216.68
8.3.160.0350.00716.54
8.3.150.0170.00516.75
8.3.140.0350.01016.47
8.3.130.0190.00616.41
8.3.120.0320.00716.63
8.3.110.0340.00816.32
8.3.100.0370.01016.44
8.3.90.0350.01016.71
8.3.80.0400.00716.32
8.3.70.0380.00816.40
8.3.60.0360.00916.41
8.3.50.0330.01016.40
8.3.40.0390.00817.60
8.3.30.0270.00617.47
8.3.20.0250.00617.42
8.3.10.0300.00817.38
8.3.00.0150.00617.45
8.2.280.0120.00816.94
8.2.270.0270.01316.39
8.2.260.0340.00516.50
8.2.250.0320.00816.49
8.2.240.0290.01016.57
8.2.230.0290.01016.61
8.2.220.0420.00716.32
8.2.210.0340.00416.17
8.2.200.0400.00416.38
8.2.190.0320.00716.41
8.2.180.0350.00816.14
8.2.170.0370.00917.93
8.2.160.0340.00717.78
8.2.150.0350.00717.38
8.2.140.0220.00417.57
8.2.130.0150.00317.61
8.2.120.0140.00417.50
8.2.110.0200.00417.73
8.2.100.0290.01217.24
8.2.90.0270.01117.53
8.2.80.0330.00817.25
8.2.70.0360.00717.58
8.2.60.0300.00517.53
8.2.50.0340.01117.12
8.2.40.0280.00817.20
8.2.30.0290.00917.17
8.2.20.0300.00817.14
8.2.10.0340.01017.41
8.2.00.0290.00917.38

preferences:
30.26 ms | 403 KiB | 5 Q