BlackFriday 2024! 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 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:

Ciara
28 days ago
I'm just gonna go with D) NULL and hope I get it right. This code is like a bad magic trick - it's trying to confuse me, but I'm not falling for it!
upvoted 0 times
Becky
2 days ago
I believe it's A) bool(false)
upvoted 0 times
...
Elvera
6 days ago
I'm going with C) int(1)
upvoted 0 times
...
Lewis
13 days ago
I think it's B) int(3)
upvoted 0 times
...
...
Sina
29 days ago
E) Array? Really? What kind of a trick question is this? I'm gonna go with D) NULL and hope I don't get tricked again.
upvoted 0 times
...
Chana
1 months ago
I'm pretty sure it's B) int(3). The `each()` function returns the current element of the array, so the `current()` function will return the last element, which is 3.
upvoted 0 times
Kenneth
17 hours ago
I agree with you, it's B) int(3). The current function will return the last element of the array.
upvoted 0 times
...
Mitsue
6 days ago
I believe it's D) NULL. The while loop will iterate through the array and the current function will return NULL at the end.
upvoted 0 times
...
Jimmie
9 days ago
I think it's C) int(1). The current function will return the first element of the array.
upvoted 0 times
...
...
Blair
1 months ago
D) NULL is the correct answer. The `while` loop consumes all the elements of the array, so the `current()` function will return NULL.
upvoted 0 times
Natalya
7 days ago
No, it's int(3) because the loop goes through all elements.
upvoted 0 times
...
Lucy
9 days ago
D) NULL
upvoted 0 times
...
Audra
10 days ago
C) int(1)
upvoted 0 times
...
Susana
11 days ago
Actually, it will be bool(false).
upvoted 0 times
...
Oliva
16 days ago
I believe it will be int(1).
upvoted 0 times
...
Titus
19 days ago
B) int(3)
upvoted 0 times
...
Phil
23 days ago
I think the output will be NULL.
upvoted 0 times
...
Toi
30 days ago
A) bool(false)
upvoted 0 times
...
...
Augustine
2 months ago
I think the output will be bool(false). The `each()` function returns false when it reaches the end of the array, so the `current()` function will return the last element of the array, which is 3.
upvoted 0 times
Salome
1 months ago
I'm pretty sure the output will be NULL. Since the `each()` function moves the internal array pointer to the end, `current()` will return NULL because the pointer is at the end of the array.
upvoted 0 times
...
Joesph
1 months ago
I believe the output will be int(1). The `each()` function moves the internal array pointer to the next element, so `current()` will return the first element of the array, which is 1.
upvoted 0 times
...
Kristian
1 months ago
I think the output will be int(3). The `each()` function returns false when it reaches the end of the array, so the `current()` function will return the last element of the array, which is 3.
upvoted 0 times
...
...
Luisa
2 months ago
I'm not sure, but I think the output will be int(3).
upvoted 0 times
...
Bambi
2 months ago
I believe the output will be NULL.
upvoted 0 times
...
Mira
2 months ago
I think the output will be int(1).
upvoted 0 times
...

Save Cancel