3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function acceptsObject(\stdClass $o) { var_dump(get_class($ob)); } $anonymousObject = new \stdClass(); acceptsObject($anonymousObject);
Output for 7.2.0
Notice: Undefined variable: ob in /in/MCsZZ on line 4 Warning: get_class() expects parameter 1 to be object, null given in /in/MCsZZ on line 4 bool(false)
Output for 5.3.20 - 7.1.10
Notice: Undefined variable: ob in /in/MCsZZ on line 4 Warning: get_class() called without object from outside a class in /in/MCsZZ on line 4 bool(false)