3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php interface I { } class B implements I { } class C extends B { function foo() {} } $rx = new \ReflectionClass('X'); $rc = new \ReflectionClass('C'); $rm = $rc->getMethod('foo'); $drc = $rm->getDeclaringClass(); var_export($rc->getName() === $drc->getName());
based on oatRq
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught ReflectionException: Class X does not exist in /in/qBUfg:15 Stack trace: #0 /in/qBUfg(15): ReflectionClass->__construct('X') #1 {main} thrown in /in/qBUfg on line 15
Process exited with code 255.
Output for 5.3.21 - 5.6.28
Fatal error: Uncaught exception 'ReflectionException' with message 'Class X does not exist' in /in/qBUfg:15 Stack trace: #0 /in/qBUfg(15): ReflectionClass->__construct('X') #1 {main} thrown in /in/qBUfg on line 15
Process exited with code 255.