3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function test(&$error) { $response = (object)array(); $fail = function($err) { $error[] = $err; return $response; }; return $fail('invalid derp'); } $error = array(); $response = test(&$error); var_dump($error); var_dump($response);
Output for 5.4.0 - 5.4.23
Fatal error: Call-time pass-by-reference has been removed in /in/IaQ8J on line 15
Process exited with code 255.
Output for 5.3.0 - 5.3.29
Deprecated: Call-time pass-by-reference has been deprecated in /in/IaQ8J on line 15 Notice: Undefined variable: response in /in/IaQ8J on line 7 array(0) { } NULL