3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function vec_add (&$a, $b) { $a['x'] += $b['x']; $a['y'] += $b['y']; $a['z'] += $b['z']; } $a = array (x => 3, y => 2, z => 5); $b = array (x => 9, y => 3, z => -7); vec_add (&$a, $b); print_r ($a);
based on RSRFB
Output for 7.0.0 - 7.0.2
Parse error: syntax error, unexpected '&' in /in/n6NJu on line 8
Process exited with code 255.
Output for 5.4.11 - 5.6.17
Fatal error: Call-time pass-by-reference has been removed in /in/n6NJu on line 8
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Deprecated: Call-time pass-by-reference has been deprecated in /in/n6NJu on line 8 Notice: Use of undefined constant x - assumed 'x' in /in/n6NJu on line 6 Notice: Use of undefined constant y - assumed 'y' in /in/n6NJu on line 6 Notice: Use of undefined constant z - assumed 'z' in /in/n6NJu on line 6 Notice: Use of undefined constant x - assumed 'x' in /in/n6NJu on line 7 Notice: Use of undefined constant y - assumed 'y' in /in/n6NJu on line 7 Notice: Use of undefined constant z - assumed 'z' in /in/n6NJu on line 7 Array ( [x] => 12 [y] => 5 [z] => -2 )