3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A { public static function withSelf(): self { return new self(); } public static function withStatic(): static { return new static(); } } class B extends A {} var_dump(A::withSelf()); // output: A var_dump(B::withSelf()); // output: A var_dump(B::withStatic()); // output: B

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.90.0110.00616.61
8.5.80.0300.01116.54
8.5.70.0370.00516.68
8.5.60.0340.00816.67
8.5.50.0360.00616.48
8.5.40.0340.00616.34
8.5.30.0350.00516.51
8.5.20.0190.00716.54
8.5.10.0310.00716.19
8.5.00.0130.00616.61
8.4.240.0280.01219.28
8.4.230.0280.01119.35
8.4.220.0320.01319.27
8.4.210.0330.00919.00
8.4.200.0310.00719.27
8.4.190.0320.01119.70
8.4.180.0310.01219.36
8.4.170.0320.01119.69
8.4.160.0240.01019.61
8.4.150.0160.00319.73
8.4.140.0230.00717.65
8.4.130.0340.00717.42
8.4.120.0340.00917.80
8.4.110.0320.01017.63
8.4.100.0350.00917.66
8.4.90.0340.00317.50
8.4.80.0380.00517.65
8.4.70.0350.00917.77
8.4.60.0350.01017.81
8.4.50.0330.01117.59
8.4.40.0360.00817.58
8.4.30.0350.00917.63
8.4.20.0310.00817.56
8.4.10.0260.00517.54
8.3.330.0380.01118.11
8.3.320.0250.01118.22
8.3.310.0300.01018.25
8.3.300.0390.00817.88
8.3.290.0320.01218.01
8.3.280.0300.00618.22
8.3.270.0280.01016.60
8.3.260.0390.00616.59
8.3.250.0330.00916.46
8.3.240.0320.01016.50
8.3.230.0320.01216.60
8.3.220.0360.01016.36
8.3.210.0370.00716.30
8.3.200.0370.00916.37
8.3.190.0370.00716.51
8.3.180.0290.00716.52
8.3.170.0310.00916.59
8.3.160.0310.00816.61
8.3.150.0280.00416.60
8.3.140.0290.00816.47
8.3.130.0140.00316.73
8.3.120.0180.00616.57
8.3.110.0190.00416.66
8.3.100.0160.00416.59
8.3.90.0170.00216.60
8.3.80.0170.00316.52
8.3.70.0150.00616.54
8.3.60.0320.00716.42
8.3.50.0290.00616.59
8.3.40.0360.00517.76
8.3.30.0310.00817.83
8.3.20.0320.00517.72
8.3.10.0270.00817.86
8.3.00.0270.00817.72
8.2.330.0490.01017.64
8.2.320.0330.00818.06
8.2.310.0260.01118.08

preferences:
49.86 ms | 773 KiB | 5 Q