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 MVMvO
Output for 7.0.0 - 7.0.2
Parse error: syntax error, unexpected '&' in /in/GeVnm on line 13
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/GeVnm on line 13
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Deprecated: Call-time pass-by-reference has been deprecated in /in/GeVnm on line 13 Notice: Use of undefined constant x - assumed 'x' in /in/GeVnm on line 10 Notice: Use of undefined constant y - assumed 'y' in /in/GeVnm on line 10 Notice: Use of undefined constant z - assumed 'z' in /in/GeVnm on line 10 Notice: Use of undefined constant x - assumed 'x' in /in/GeVnm on line 11 Notice: Use of undefined constant y - assumed 'y' in /in/GeVnm on line 11 Notice: Use of undefined constant z - assumed 'z' in /in/GeVnm on line 11 Array ( [x] => 12 [y] => 5 [z] => -2 )