<<< Previous question <<< Question ID#0692.md >>> Next question >>>
What is the output of the following script ?
function generate() {
for ($i = 1; $i <= 3; $i++) {
yield $i;
}
}
$generator = generate();
if (is_array($generator)) {
echo "Is Array";
} elseif(is_object($generator)) {
echo "Is Object";
} else {
echo "Is none of the above";
}
- A) Is Object
- B) Is Array
- C) Is none of the above
- D) an errpr
Answer
Answer: A