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)- A13% (5)
- B77% (30)
- C8% (3)
- D3% (1)
Topics
#array union operator#array_merge#numeric keys#array precedence
Community Discussion
No community discussion yet for this question.