Skip to content

Latest commit

 

History

History
31 lines (27 loc) · 584 Bytes

0692.md

File metadata and controls

31 lines (27 loc) · 584 Bytes

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