3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class foo { function say($x) { echo "I was told to say $x"; } } $foo = new foo(); function a($x) { global $foo; $foo->say($x); } function b($x) { $GLOBALS['foo']->say($x); } a("hiya"); b("howdy");
Output for 4.3.0 - 7.1.0
I was told to say hiyaI was told to say howdy