3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function foo($array) { $array['extra'] = 'extra'; return $array; } function bar(&$array) { $array['extra'] = 'extra'; } $foo = array('test_foo' => 'test_foo'); $bar = array('test_bar' => 'test_bar'); foo(&$foo); bar($bar); print_r($foo); print_r($orifoo); print_r($bar); ?>
Output for 5.4.0 - 5.4.26
Fatal error: Call-time pass-by-reference has been removed; If you would like to pass argument by reference, modify the declaration of foo(). in /in/Psj2q on line 16
Process exited with code 255.
Output for 5.3.0 - 5.3.29
Deprecated: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of foo(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in /in/Psj2q on line 16 Array ( [test_foo] => test_foo [extra] => extra ) Notice: Undefined variable: orifoo in /in/Psj2q on line 21 Array ( [test_bar] => test_bar [extra] => extra )