3v4l.org

run code in 200+ 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 - 7.2.0
No Yes Yes No Yes Yes
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