-
What will be the output of the following PHP code ?
<?php
$m = 15;
$n = 8;
$p = fun(15,8);
function fun($m,$n)
{
$n = 7;
return $m - $n + $n - $m;
}
echo $m;
echo $n;
echo $p;
?>
-
- Error
- 18
- 8
- 1580
- None of these
Correct Option: D
The value returned from the function is 0, and value of m is 15, value of n is 8 and p is 0.