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 6 Question 72 Discussion

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

How many times will the function counter() be executed in the following code?

function counter($start, &$stop)

{

if ($stop > $start)

{

return;

}

counter($start--, ++$stop);

}

$start = 5;

$stop = 2;

counter($start, $stop);

Show Suggested Answer Hide Answer
Suggested Answer: B

Contribute your Thoughts:

Gail
1 months ago
Wait, is this a coding exam or a stand-up comedy routine? I'm feeling inspired to write some recursive jokes!
upvoted 0 times
...
Hayley
1 months ago
This is a tricky one! I bet the instructor is just trying to confuse us. Time to break out the whiteboard and some coffee!
upvoted 0 times
Edna
13 days ago
A) 3
upvoted 0 times
...
...
Princess
2 months ago
D) 6 has to be the right answer. The function calls itself recursively, so it will keep going until the condition is no longer met.
upvoted 0 times
Erick
12 days ago
D) 6
upvoted 0 times
...
Sharee
18 days ago
C) 5
upvoted 0 times
...
Yolando
1 months ago
B) 4
upvoted 0 times
...
Irving
1 months ago
A) 3
upvoted 0 times
...
...
Deonna
2 months ago
Hmm, I'm not sure about this one. Let me think it through step-by-step. I'll try to solve it on paper to be sure.
upvoted 0 times
...
Gerald
2 months ago
I see, I think it's because the function is called recursively until $stop is greater than $start.
upvoted 0 times
...
Vilma
2 months ago
I believe it will be executed 5 times.
upvoted 0 times
...
Julio
2 months ago
I think the correct answer is C) 5. The function counter() will be executed 5 times because the loop continues until $stop is greater than $start.
upvoted 0 times
Evangelina
14 days ago
It's B) 4 because the function is called 4 times before the condition is met.
upvoted 0 times
...
Maddie
17 days ago
Really? I thought it was C) 5 too.
upvoted 0 times
...
Darell
1 months ago
No, it's actually B) 4.
upvoted 0 times
...
Socorro
1 months ago
I think the correct answer is C) 5.
upvoted 0 times
...
...
Gerald
2 months ago
I think the function will be executed 4 times.
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