3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace ParserReflection\Stub; abstract class AbstractClassWithMethods { const TEST = 5; private function testParam($a, $b = null, $c = self::class, $d = self::TEST) {} } $refMethod = new \ReflectionMethod('ParserReflection\Stub\AbstractClassWithMethods', 'testParam'); echo "Exported: ", $refMethod;
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Exported: Method [ <user> private method testParam ] { @@ /in/7FTPY 9 - 9 - Parameters [4] { Parameter #0 [ <required> $a ] Parameter #1 [ <optional> $b = NULL ] Parameter #2 [ <optional> $c = 'ParserReflection\\Stub\\AbstractClassWithMethods' ] Parameter #3 [ <optional> $d = self::TEST ] } }
Output for 5.5.0 - 5.5.20, 5.6.0 - 5.6.4, 5.6.17 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30
Exported: Method [ <user> private method testParam ] { @@ /in/7FTPY 9 - 9 - Parameters [4] { Parameter #0 [ <required> $a ] Parameter #1 [ <optional> $b = NULL ] Parameter #2 [ <optional> $c = 'ParserReflectio...' ] Parameter #3 [ <optional> $d = 5 ] } }
Output for 5.5.21 - 5.5.38, 5.6.5 - 5.6.16
Exported:
Process exited with code 139.

preferences:
223.13 ms | 402 KiB | 330 Q