Medium
What will this code display?
<?php
function gen()
{
yield 1;
yield 2;
yield from gen2();
}
function gen2()
{
yield 3;
yield 4;
}
foreach(gen() as $val)
{
echo $val, PHP_EOL;
}
Author: Julien BreuxStatus: PublishedQuestion passed 1122 times
Edit
0
Community EvaluationsNo one has reviewed this question yet, be the first!
4
Which of these PHP code snippets are valid?2
What will this code display?2
Which of the following are PHP framework names?2
Write a PHP code that displays the full name of a person.2
Which of the following statements are correct?3
Display the first element of an array in PHP3
What will this code display?