3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { public $callback; public function test() { call_user_func($this->callback, new Exception); } } class Bar { public function trololol() { $bar = new Bar; $bar->callback = function (Exception $e) { var_dump($this); }; $bar->test(); } } (new Bar)->trololol();
based on CX23S
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to undefined method Bar::test() in /in/AJh7Q:23 Stack trace: #0 /in/AJh7Q(27): Bar->trololol() #1 {main} thrown in /in/AJh7Q on line 23
Process exited with code 255.
Output for 5.4.10 - 5.6.28
Fatal error: Call to undefined method Bar::test() in /in/AJh7Q on line 23
Process exited with code 255.
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/AJh7Q on line 27
Process exited with code 255.