-
What will be the output of the following PHP code?
<?php
function calc1(&$n)
{
$n += 7;
}
function calc2(&$n)
{
$n += 8;
}
$OrignalNumber = 12;
calc1( $OrignalNumber );
echo "Original Number is $OrignalNumber\n";
calc2( $OrignalNumber );
echo "Original Number is $OrignalNumber\n";
?>
-
- Original Number is 27
Original Number is 19 - Original Number is 12
Original Number is 19 - Original Number is 19
Original Number is 27 - Original Number is 15
Original Number is 12 - None of these
- Original Number is 27
Correct Option: C
calc2() passes value of the variable by reference.