The code will compile successfully but will not print anything.
The code will compile successfully and will print the following:
array(3) {
[0]=>
NULL
[1]=>
NULL
[2]=>
NULL
}
The code will compile successfully and will print the following:array(3) {
[0]=>
Five
[1]=>
Six
[2]=>
Seven
}
Which of the given statements is correct about the following PHP 7.1 code snippet?
function example() {
foreach (range(5, 7) as $a){yield;
}
}
var_dump(iterator_to_array(example()));
?>
Correct Answer:
The code will compile successfully and will print the following:
array(3) {
[0]=>
NULL
[1]=>
NULL
[2]=>
NULL
}
Explanation:
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
More PHP 5 MCQ Questions