What is the value of $a and $b after the function call?
<?php
function doSomething( &$arg )
{
$return = $arg;
$arg += 1;
return $return;
}
$a = 3;
$b = doSomething( $a );
?>
<?php
function doSomething( &$arg )
{
$return = $arg;
$arg += 1;
return $return;
}
$a = 3;
$b = doSomething( $a );
?>
A. a is 3 and b is 4
B. a is 4 and b is 3
C. Both are 3
D. Both are 4
Answer: Option B

Join The Discussion