Skip to content

Latest commit

 

History

History
18 lines (15 loc) · 533 Bytes

0773.md

File metadata and controls

18 lines (15 loc) · 533 Bytes

What is the result of the following code?

<?= (function(){ return [$x, $x + 1, $x + 2];})(4)[2];
  • A) The "2" value together with PHP noticw saying that it does not recognize the $x variable;
  • B) A PHP warning saying that you need to store the result in a variable before displayng it;
  • C) 6
  • D) A parse error;
Answer

Answer: A