3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Bar { } class Foo extends Bar { function getSelf (self $a): self { } function getStatic (): static { } } $refMethodSelf = new ReflectionMethod('Foo', 'getSelf'); $refMethodStatic = new ReflectionMethod('Foo', '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.0310.00717.55
8.5.20.0310.01016.55
8.5.10.0410.01116.55
8.5.00.0310.01116.59
8.4.180.0230.00819.59

preferences:
33.36 ms | 403 KiB | 5 Q