<<< Previous question <<< Question ID#0089.md >>> Next question >>>
Consider the following PHP script:
$a = 5;
$b = 10;
function Mul() {
// ????
}
Mul();
print($b);
What can you write instead of // ???? on line 4 to get the output 50? Each correct answer represents a complete solution. Choose all that apply.
- A)
global $a, $b; $b = $a * $b;
- B)
$GLOBALS['b'] = $GLOBALS['a'] * $GLOBALS['b'];
- C)
globals($b = $a * $b);
- D)
$b = $a * $b;
Answer
Answer: A, B