-
What will be the output of the following PHP code ?
<?php
$p = 6;
$q = 5;
function Res($p = 5, $q = 6)
{
$r = $p+$q/$q+$p;
echo "$r";
}
echo $p;
echo $q;
echo $r;
Res($p, $q);
?>
-
- Nothing
- 6
- 5
- 65
- 6513
Correct Option: E
Firstly, the statements outside the function are printed, since r is not defined it’ll no value is printed for r. Next the function is called and the value of r inside the function is printed.