3v4l.org

run code in 300+ 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.0300.00517.00
8.5.20.0100.00718.45
8.4.180.0120.01021.61
8.4.170.0160.00821.46
8.4.90.0070.01319.54
8.3.300.0120.00920.07
8.3.180.0080.01016.74
8.3.50.0140.00416.90

preferences:
38.29 ms | 407 KiB | 6 Q