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 7IeDH
Output for 7.0.0 - 7.0.4
Parse error: syntax error, unexpected '&' in /in/0vP4W on line 14
Process exited with code 255.
Output for 5.4.8 - 5.6.19
Fatal error: Call-time pass-by-reference has been removed in /in/0vP4W on line 14
Process exited with code 255.
Output for 5.3.18 - 5.3.29
Deprecated: Call-time pass-by-reference has been deprecated in /in/0vP4W on line 14 Notice: Use of undefined constant x - assumed 'x' in /in/0vP4W on line 11 Notice: Use of undefined constant y - assumed 'y' in /in/0vP4W on line 11 Notice: Use of undefined constant z - assumed 'z' in /in/0vP4W on line 11 Notice: Use of undefined constant x - assumed 'x' in /in/0vP4W on line 12 Notice: Use of undefined constant y - assumed 'y' in /in/0vP4W on line 12 Notice: Use of undefined constant z - assumed 'z' in /in/0vP4W on line 12 Array ( [x] => 12 [y] => 5 [z] => -2 )