Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Zend Exam 200-710 Topic 1 Question 79 Discussion

Actual exam question for Zend's 200-710 exam
Question #: 79
Topic #: 1
[All 200-710 Questions]

What will be the result of the following operation?

$a = array_merge([1,2,3] + [4=>1,5,6]);

echo $a[2];

Show Suggested Answer Hide Answer
Suggested Answer: A

Contribute your Thoughts:

Teri
24 days ago
I'd say the result is 'a good time', but that's probably not the right answer for a certification exam.
upvoted 0 times
Vincent
1 days ago
B) 3
upvoted 0 times
...
Arlene
3 days ago
A) 4
upvoted 0 times
...
...
Katie
1 months ago
E) Parse error. The + operator is not valid for merging arrays in PHP, so this code will result in a syntax error.
upvoted 0 times
Phil
8 days ago
Make sure to use the correct syntax for merging arrays in PHP.
upvoted 0 times
...
Carin
22 days ago
Yes, you're right. The code will result in a syntax error.
upvoted 0 times
...
Donte
26 days ago
I think the answer is E) Parse error.
upvoted 0 times
...
...
Cherelle
1 months ago
I'm going with D) false. The array_merge function returns a new array, so $a[2] will not be defined, resulting in a false value.
upvoted 0 times
Gussie
18 days ago
I think it's E) Parse error because the syntax of array_merge is incorrect.
upvoted 0 times
...
...
Daniel
2 months ago
The correct answer is C) 2. The + operator will merge the arrays, but it will preserve the keys from the second array, so the element at index 2 will be 2.
upvoted 0 times
Floyd
9 days ago
No, it's actually C) 2. The keys from the second array are preserved.
upvoted 0 times
...
Tonja
1 months ago
I think the answer is B) 3.
upvoted 0 times
...
...
Dannette
2 months ago
I think the answer is B) 3. The array_merge function will combine the two arrays, and the element at index 2 will be 3 from the first array.
upvoted 0 times
Vivan
22 days ago
You're welcome!
upvoted 0 times
...
Nohemi
27 days ago
Oh, I see. Thanks for clarifying.
upvoted 0 times
...
Elmira
30 days ago
No, it's actually A) 4. The keys from the second array will overwrite the keys from the first array.
upvoted 0 times
...
Shala
1 months ago
I think the answer is B) 3.
upvoted 0 times
...
...
Ciara
2 months ago
I'm not sure, but I think it might be a parse error.
upvoted 0 times
...
Leota
2 months ago
I believe it will be false.
upvoted 0 times
...
Wilda
2 months ago
I think the result will be 3.
upvoted 0 times
...

Save Cancel