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 2 Question 73 Discussion

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

What will be the output value of the following code?

$array = array(1,2,3);

while (list(,$v) = each($array));

var_dump(current($array));

Show Suggested Answer Hide Answer
Suggested Answer: A

Contribute your Thoughts:

Elmira
10 months ago
Haha, this question is a real brain-teaser! I'm going to go with option B, int(3), because that's the only answer that seems somewhat logical.
upvoted 0 times
Johana
8 months ago
I agree with option B, int(3)
upvoted 0 times
...
Sherman
8 months ago
I'm going with bool(false)
upvoted 0 times
...
Mireya
9 months ago
I believe it will be NULL
upvoted 0 times
...
Kristel
9 months ago
I think the output will be int(1)
upvoted 0 times
...
...
Harris
10 months ago
Wait, what? This question is as clear as mud. I'll just go with option E, Array, because that's the only answer that makes sense to me.
upvoted 0 times
Corrie
9 months ago
I agree with you, I'll choose Array
upvoted 0 times
...
Toshia
10 months ago
I'm going with bool(false)
upvoted 0 times
...
Leontine
10 months ago
I believe it will be NULL
upvoted 0 times
...
Viva
10 months ago
I think the output will be int(1)
upvoted 0 times
...
...
Kendra
10 months ago
I think the output will be int(3) because the current function returns the current element in an array.
upvoted 0 times
...
Claudio
10 months ago
I'm not sure, but I think it might be bool(false).
upvoted 0 times
...
Leigha
10 months ago
I'm not sure about this one. The code looks a bit weird, but I'm going to go with option D, NULL, just to be safe.
upvoted 0 times
Lauran
10 months ago
I agree, let's go with option D.
upvoted 0 times
...
Lenna
10 months ago
I think it will be option D, NULL.
upvoted 0 times
...
...
Margo
10 months ago
I believe the output will be NULL.
upvoted 0 times
...
Marva
10 months ago
I think the output will be int(1).
upvoted 0 times
...
Juan
11 months ago
No way, the output is clearly int(3)! The while loop just iterates through the array, and current() will return the last element.
upvoted 0 times
Mammie
10 months ago
No, it's actually bool(false).
upvoted 0 times
...
Rose
10 months ago
I think the output is int(3).
upvoted 0 times
...
...
Nan
11 months ago
Hmm, I think the output will be bool(false), since the while loop has already exhausted the array and current() will return the last element's value.
upvoted 0 times
Christa
10 months ago
I agree with you, it should be bool(false).
upvoted 0 times
...
Devora
10 months ago
I'm pretty sure it will be int(3).
upvoted 0 times
...
Quentin
10 months ago
I believe it will be NULL.
upvoted 0 times
...
Shenika
10 months ago
I think the output will be int(1).
upvoted 0 times
...
Brett
10 months ago
I agree with you, the output should be bool(false) as current() will return false after the while loop.
upvoted 0 times
...
Aliza
10 months ago
I believe it will be NULL because the array has been exhausted by the while loop.
upvoted 0 times
...
Dawne
11 months ago
I think it will be int(1) because current() will return the first element's value.
upvoted 0 times
...
...

Save Cancel