3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Doer { public function doThis(){ return 'did something'; } } class DoerDecorator { private $doer; public function __construct(Doer $doer){ $this->doer = $doer; } public function __call($name, $arguments){ return call_user_func_array([$this->doer, $name], $arguments); } public function doSomethingElse(){ return 'did something else'; } } $do = new DoerDecorator(new Doer); var_dump($do->doThis()); var_dump($do->doSomethingElse());
based on vRbQq
Output for 5.5.0 - 7.3.0alpha1
string(13) "did something" string(18) "did something else"