3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo { function __construct() { var_dump(get_class()); var_dump(get_class(null)); } } new Foo;
based on tovaX
Output for 5.3.1 - 7.1.0
string(3) "Foo" string(3) "Foo"
Output for 5.3.0
string(3) "Foo" Warning: get_class() expects parameter 1 to be object, null given in /in/UEr2i on line 6 bool(false)
Output for 5.0.0 - 5.2.17
string(3) "Foo" bool(false)
Output for 4.3.0 - 4.4.9