Question: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);

?>

 

A Array

(

[x]=>9

[y]=>3

[z]=>-7

)

 

B Array

(

[x]=>3

[y]=>2

[z]=>5

)

 

C Array

(

[x]=>12

[y]=>5

[z]=>-2

)

 

D Error 

E None 

+ Answer
+ Report
Total Preview: 1998

Copyright © 2024. Powered by Intellect Software Ltd