3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Bar { } class Foo extends Bar { function getSelf (self $a): self { } function getStatic (): static { } } $foo = new Foo(); $refObj = new ReflectionObject($foo); $refMethodSelf = $refObj->getMethod('getSelf'); $refMethodStatic = $refObj->getMethod('getStatic'); $refParam = $refMethodSelf->getParameters()[0]; print_r(array( 'paramType' => $refParam->getType()->getName(), 'returnTypeSelf' => $refMethodSelf->getReturnType()->getName(), 'returnTypeStatic' => $refMethodStatic->getReturnType()->getName(), ));

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.0210.00516.76
8.5.20.0210.00717.42
8.5.10.0320.00816.45
8.5.00.0310.00916.42
8.4.180.0260.01120.11
8.4.170.0260.00920.57
8.4.160.0320.00619.79
8.4.150.0170.00219.69
8.4.140.0350.01017.57
8.4.130.0350.00817.65
8.4.120.0300.01017.79
8.4.110.0230.00717.89
8.4.100.0180.00417.81
8.4.90.0130.00818.72
8.4.80.0350.00817.87
8.4.70.0360.00717.66
8.4.60.0370.00917.73
8.4.50.0380.00717.72
8.4.40.0400.01117.72
8.4.30.0350.00417.64
8.4.20.0270.00117.54
8.4.10.0230.00417.48
8.3.300.0150.00719.08
8.3.290.0330.00718.20
8.3.280.0270.00618.16
8.3.270.0150.00416.65
8.3.260.0350.01016.63
8.3.250.0330.00816.73
8.3.240.0330.00516.54
8.3.230.0270.01116.71
8.3.220.0380.00916.80
8.3.210.0340.01116.47
8.3.200.0220.00616.75
8.3.190.0200.00916.34
8.3.180.0230.00816.66
8.3.170.0350.00916.68
8.3.160.0410.00616.46
8.3.150.0390.00816.55
8.3.140.0300.00616.64
8.3.130.0240.00316.50
8.3.120.0270.00516.53
8.3.110.0290.00316.86
8.3.100.0190.00216.85
8.3.90.0250.00916.37
8.3.80.0410.00516.59
8.3.70.0300.00916.67
8.3.60.0150.00516.77
8.3.50.0150.00516.83
8.3.40.0130.00717.84
8.3.30.0150.00317.74
8.3.20.0280.00917.84
8.3.10.0310.00517.89
8.3.00.0250.00717.85

preferences:
45.2 ms | 704 KiB | 5 Q