3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class foo { function do_foo() { $var = 'a default value'; echo "Doing foo."; echo $this->var; } } $bar = new foo; $bar -> do_foo(); ?>
based on UfHKm
Output for 5.3.18 - 7.3.0rc4
Doing foo. Notice: Undefined property: foo::$var in /in/Gg7id on line 8