MCQs > IT & Programming > PHP 5 > Which is correct about the following PHP 7.1 code? function example() { static $cnt = 0; $cnt++; echo $cnt; if ($cnt < 5) { example(); } $cnt--; } ?>

PHP 5 MCQs

Which of the given statements is correct about the following PHP 7.1 code?

function example()

{

static $cnt = 0;

$cnt++;

echo $cnt;

if ($cnt < 5) {

example();

}

$cnt--;

}

?>

Answer

Correct Answer:

The code will compile successfully but will not print any output. 

Explanation:

Note: This Question is unanswered, help us to find answer for this one

PHP 5 Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

PHP 5 Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it