3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php interface MyInterface { } class BaseClass implements MyInterface{ } 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', 'MyInterface')? "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.1.0
No Yes Yes Yes No Yes Yes
Output for 5.0.3 - 5.3.8
No Yes Yes Yes No No Yes
Output for 5.0.0 - 5.0.2
No No No No No No Yes
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING in /in/KjCgn on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING in /in/KjCgn on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/KjCgn on line 2
Process exited with code 255.