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);
Correct answer is 5? brcause:
1 run for start=5 and stop=2
2 run for start=5 and stop=3
3 run for start=5 and stop=4
4 run for start=5 and stop=5
and again... 5 run for start=5 and stop=6 will return without changes for $stop variable
This section is not available anymore. Please use the main Exam Page.200-550 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
linkmaster
4 years, 2 months agochayan_1089
5 years, 2 months ago