3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Something { public function otherThing(stdClass $canBeNullOrAnObject = null) { echo get_class($canBeNullOrAnObject); } } $s = new Something; $s->otherThing(); echo PHP_EOL; $s->otherThing(new stdClass);
Output for 7.2.0
Warning: get_class() expects parameter 1 to be object, null given in /in/3QLLK on line 7 stdClass
Output for 5.3.19 - 7.1.10
Something stdClass