MCQs > IT & Programming > PHP > What is the outpu? 3, y => 2, z => 5); $b = array (x => 9, y => 3, z => -7); vec_add (&$a, $b); print_r ($a); ?>

PHP MCQs

What is the output of the 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);

?>

Answer

Correct Answer: Array ( [x] => 12 [y] => 5 [z] => -2 )

Explanation:

Note: This Question is unanswered, help us to find answer for this one

PHP Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

PHP Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it