πŸ“Š PHP
Q. What is the value of $a and $b after the function call?
Code:
<?php
function doSomething(&$argument) 
    {
        $Result = $argument;
        $argument += 1;
        return $Result;	
    }
$n = 5;
$m = doSomething($n);
echo "n = " . $n . " and m = " . $m;
?>
  • (A) n = 6
  • (B) n = 6 and m = 5
  • (C) m = 6
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (B) n = 6 and m = 5

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
59129
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Neha Sharma
Publisher
πŸ“ˆ
86%
Success Rate