3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class A { function a() {echo "a";} } class B { function a() {echo "b";} } class C extends A { function a() {echo "c";} } $b = new B(); var_dump($b instanceof A); $c = new C(); var_dump($c instanceof A); var_dump('bla' instanceof A); var_dump(null instanceof A);
Output for hhvm-3.10.0 - 3.12.0
bool(false) abool(true) bool(false) bool(false)
Output for 5.3.7 - 5.4.26
Fatal error: instanceof expects an object instance, constant given in /in/65ocv on line 13
Process exited with code 255.