3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class a { public $retorno; public function test() { try { throw new Exception('Error!'); } catch(Exception $e) { $this->retorno = 'mensagem!'; } } public function response($e) { echo $this->retorno; } public function __destruct() { $this->response(); } } $a = new a; $a->test();
based on 3SHOB
Output for 7.1.0 - 7.2.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function a::response(), 0 passed in /in/a8LnB on line 23 and exactly 1 expected in /in/a8LnB:16 Stack trace: #0 /in/a8LnB(23): a->response() #1 [internal function]: a->__destruct() #2 {main} thrown in /in/a8LnB on line 16
Process exited with code 255.
Output for 5.3.21 - 7.0.20
Warning: Missing argument 1 for a::response(), called in /in/a8LnB on line 23 and defined in /in/a8LnB on line 16 mensagem!