3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Home { private $foo; public function __construct(){ $this->foo = "bar"; } } $class = "home"; var_dump(get_class($home));
based on gjAI2
Output for 7.2.0
Notice: Undefined variable: home in /in/Ki1O3 on line 12 Warning: get_class() expects parameter 1 to be object, null given in /in/Ki1O3 on line 12 bool(false)
Output for 5.3.19 - 7.1.10
Notice: Undefined variable: home in /in/Ki1O3 on line 12 Warning: get_class() called without object from outside a class in /in/Ki1O3 on line 12 bool(false)