3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Test extends stdClass { function sayHello() { return 'Hello, ' . $this->val . '!'; } } $c = new Test; $c->val = 'Mr. Duck'; var_dump($c->sayHello());
Output for 4.3.0 - 7.2.0
string(16) "Hello, Mr. Duck!"