What is the result of executing following code?

<?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);
?>

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
PHP quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes