3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { public function bar() {} public static function baz() {} } $obj = new Foo(); $reflected = new ReflectionClass($obj); var_dump($reflected->getMethods(ReflectionMethod::IS_PUBLIC));
based on M6FH3
Output for 7.0.0 - 7.2.0
array(2) { [0]=> object(ReflectionMethod)#3 (2) { ["name"]=> string(3) "bar" ["class"]=> string(3) "Foo" } [1]=> object(ReflectionMethod)#4 (2) { ["name"]=> string(3) "baz" ["class"]=> string(3) "Foo" } }
Output for 5.3.18 - 5.6.28
array(2) { [0]=> &object(ReflectionMethod)#3 (2) { ["name"]=> string(3) "bar" ["class"]=> string(3) "Foo" } [1]=> &object(ReflectionMethod)#4 (2) { ["name"]=> string(3) "baz" ["class"]=> string(3) "Foo" } }