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
1 months 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
Sharan
1 days ago
B) 3
upvoted 0 times
...
Matilda
7 days ago
E) Parse error
upvoted 0 times
...
Vincent
16 days ago
B) 3
upvoted 0 times
...
Arlene
18 days ago
A) 4
upvoted 0 times
...
...
Katie
2 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
23 days ago
Make sure to use the correct syntax for merging arrays in PHP.
upvoted 0 times
...
Carin
1 months ago
Yes, you're right. The code will result in a syntax error.
upvoted 0 times
...
Donte
1 months ago
I think the answer is E) Parse error.
upvoted 0 times
...
...
Cherelle
2 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
Yvonne
3 days ago
I agree with B) 3. The value at index 2 in the merged array is 3.
upvoted 0 times
...
France
8 days ago
I believe the correct answer is B) 3. The index 2 in the merged array corresponds to the value 3.
upvoted 0 times
...
Gussie
1 months 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
24 days ago
No, it's actually C) 2. The keys from the second array are preserved.
upvoted 0 times
...
Tonja
2 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
1 months ago
You're welcome!
upvoted 0 times
...
Nohemi
1 months ago
Oh, I see. Thanks for clarifying.
upvoted 0 times
...
Elmira
2 months 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
2 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
3 months ago
I think the result will be 3.
upvoted 0 times
...

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77