3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { public $x; public function foo() { $this->x(42); } } $a = new A; $a->x = function($v) {var_dump($v);}; ($a->foo)();
based on HYiYm
Output for 7.0.0 - 7.2.0
Notice: Undefined property: A::$foo in /in/PBOFq on line 11 Fatal error: Uncaught Error: Function name must be a string in /in/PBOFq:11 Stack trace: #0 {main} thrown in /in/PBOFq on line 11
Process exited with code 255.
Output for 5.4.0 - 5.6.26
Parse error: syntax error, unexpected '(' in /in/PBOFq on line 11
Process exited with code 255.