MCQ
Single Best Answer
Not Set
QWhat will be the output of the following code?
< ?php
function track() {
static $count = 0;
$count++;
echo $count ;
}
track();
track();
track();
?>
ID: #2364
PHP Basic MCQ
1,235 views
Question Info
#2364Q ID
Not SetDifficulty
PHP Basic MCQTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer: Option A
Explanation
Because $count is static, it retains its previous value each time the function is executed.
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic