3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo { public function & bar() { return $this->var = $var = $this->baz(); } public function baz() { return 'hello'; } } $foo = new Foo(); $var = $foo->bar(); var_dump($var);
Output for 5.6.28 - 7.1.0
Notice: Only variable references should be returned by reference in /in/VW9aB on line 9 string(5) "hello"