3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class BaseClass { } class MyClass extends BaseClass{ } $object = new MyClass(); echo @is_subclass_of('BaseClass', 'BaseClass')? "Yes\n":"No\n"; echo @is_subclass_of('MyClass', 'BaseClass')? "Yes\n":"No\n"; echo @is_subclass_of('myclass', 'baseclass')? "Yes\n":"No\n"; echo @is_subclass_of('myClass', 'baseclass', false)? "Yes\n":"No\n"; echo @is_subclass_of($object, 'baseclass', false)? "Yes\n":"No\n"; echo @is_subclass_of($object, 'BaseClass')? "Yes\n":"No\n";
Output for 5.3.9 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
No Yes Yes No Yes Yes
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.0.3 - 5.3.8
No Yes Yes No No Yes
Output for 4.3.0 - 5.0.2
No No No No No Yes