MCQs > IT & Programming > PHP 5 > Which of the given code statements should replace ??? in the following PHP 7.1 code snippet, so that 7, 6, 5, 4, is printed as output? function &example() { $var = 8; while ($var > 4) { yield $var; } } ??? } ?>

PHP 5 MCQs

Which of the given code statements should replace ??? in the following PHP 7.1 code snippet, so that 7, 6, 5, 4, is printed as output?

function &example() {

$var = 8;

while ($var > 4) {

yield $var;

}

}

???

}

?>


Answer

Correct Answer:

foreach (example() as &$num) {

echo (--$num).', ';


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