3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php Class A { public function __call($method, $args){ // $test = &$args[0]; call_user_func_array(array($this, 'test'), $args); } protected function test(&$data) { $data = "done"; } } $data = 42; $a = new A(); $a->test(&$data); var_dump($data); die();
based on bqO40
Output for 7.0.0 - 7.0.1
Parse error: syntax error, unexpected '&' in /in/SWmQ0 on line 21
Process exited with code 255.
Output for 5.4.11 - 5.6.16
Fatal error: Call-time pass-by-reference has been removed in /in/SWmQ0 on line 21
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Deprecated: Call-time pass-by-reference has been deprecated in /in/SWmQ0 on line 21 string(4) "done"