3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php if(version_compare(PHP_VERSION, '5') < 0) { die(1); } class C { function M($p = 0) { } } $rc = new ReflectionClass('C'); $rmList = $rc->getMethods(); $rm = $rmList[0]; var_dump($rm);
Output for 5.0.0 - 5.6.28, 7.0.0 - 7.1.0
object(ReflectionMethod)#2 (2) { ["name"]=> string(1) "M" ["class"]=> string(1) "C" }
Output for hhvm-3.10.0 - 3.12.0
object(ReflectionMethod)#3 (2) { ["name"]=> string(1) "M" ["class"]=> string(1) "C" }
Output for 4.3.0 - 4.4.9

Process exited with code 1.