ExamVeda
Login
Home
Operators and Expressions in php
?

What will be the output of the following PHP code ?
<?php
function fun($x,$y)
{
    $x = 4;
    $y = 3;
    $z = $x + $y / $y + $x;
    echo "$z";
}
fun(3, 4); 
?>

Answer & Solution
Correct Answer: Option B
Value 3, 4 is passed to the function but that is lost because x and y are initialised to 4 and 3 inside the function. Therefore we get the given result.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.