3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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;
based on P9DXo
Output for 5.6.17 - 7.2.0
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.24 - 5.6.16
Exported:
Process exited with code 139.
Output for 5.4.10 - 5.4.45
Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) in /in/7FTPY on line 9
Process exited with code 255.
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected T_CLASS, expecting T_STRING in /in/7FTPY on line 9
Process exited with code 255.