Skip to content

Latest commit

 

History

History
41 lines (34 loc) · 672 Bytes

0089.md

File metadata and controls

41 lines (34 loc) · 672 Bytes

Consider the following PHP script:

$a = 5$b = 10function 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