テックアイエスガイド エディター
無料プログラミング体験会の予約
実行
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<!DOCTYPE html>
<html>
<body>
<?php
function countTo4() {
yield from [1, 2, 3];
yield 4;
}
foreach(countTo4() as $number) {
echo $number;
echo "<br>";
}
?>
</body>
</html>