nerdexam
Zend

200-710 · Question #113

What will be the result of the following operation? ``php $a = array_merge([1,2,3] + [4=>1,5,6]); echo $a[2]; ``

The correct answer is B. 3. See the full explanation below for the reasoning.

Arrays

Question

What will be the result of the following operation?
$a = array_merge([1,2,3] + [4=>1,5,6]);
echo $a[2];

Options

  • A4
  • B3
  • C7
  • Dfalse
  • EParse error

How the community answered

(39 responses)
  • A
    13% (5)
  • B
    77% (30)
  • C
    8% (3)
  • D
    3% (1)

Topics

#array union operator#array_merge#numeric keys#array precedence

Community Discussion

No community discussion yet for this question.

Full 200-710 Practice