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 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:

Blair
4 days 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
...
Augustine
12 days 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
Joesph
2 days 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
5 days 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
13 days ago
I'm not sure, but I think the output will be int(3).
upvoted 0 times
...
Bambi
18 days ago
I believe the output will be NULL.
upvoted 0 times
...
Mira
26 days ago
I think the output will be int(1).
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