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();
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to undefined method A::x() in /in/HYiYm:6 Stack trace: #0 /in/HYiYm(11): A->foo() #1 {main} thrown in /in/HYiYm on line 6
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Fatal error: Call to undefined method A::x() in /in/HYiYm on line 6
Process exited with code 255.