Q. What is the value of $a and $b after the function call?

Code:
<?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
πŸ’¬ Discuss
βœ… Correct Answer: (B) a is 4 and b is 3

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
254
Total Visits
πŸ“½οΈ
5 y ago
Published
πŸŽ–οΈ
Santosh Mishra
Publisher
πŸ“ˆ
84%
Success Rate