3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { public function load($file, $keymap) {} public function write($file, $keymap, $data) {} private function validate($data) {} } $reflection = new \ReflectionClass(); var_dump($reflection->getMethods());
Output for 7.1.0 - 7.3.0rc3
Warning: ReflectionClass::__construct() expects exactly 1 parameter, 0 given in /in/TJQZl on line 11 Fatal error: Uncaught Error: Internal error: Failed to retrieve the reflection object in /in/TJQZl:13 Stack trace: #0 /in/TJQZl(13): ReflectionClass->getMethods() #1 {main} thrown in /in/TJQZl on line 13
Process exited with code 255.
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.0.20
Warning: ReflectionClass::__construct() expects exactly 1 parameter, 0 given in /in/TJQZl on line 11 Fatal error: ReflectionClass::getMethods(): Internal error: Failed to retrieve the reflection object in /in/TJQZl on line 13
Process exited with code 255.
Output for hhvm-3.15.4
Warning: __construct() expects exactly 1 parameter, 0 given in /in/TJQZl on line 11 Notice: Undefined variable: name_or_obj in /in/TJQZl on line 11 Notice: Undefined variable: name_or_obj in /in/TJQZl on line 11 Fatal error: Uncaught TypeError: Argument 1 passed to ReflectionClass::__init() must be an instance of string, null given in /in/TJQZl:11 Stack trace: #0 (): ReflectionClass->__init() #1 /in/TJQZl(11): ReflectionClass->__construct() #2 {main}
Process exited with code 255.