PHP 5.5 ã§ã¸ã§ãã¬ã¼ã¿ãå°å
¥ããããã¨ã«ãªãã¾ããã PHP ã«ããã¦ã¸ã§ãã¬ã¼ã¿ã¯ Iterator ã¤ã³ã¿ã¼ãã§ã¤ã¹ãå®è£
ããã¯ã©ã¹ã§æ¬¡ã®ã¡ã½ãããå®ç¾©ããã¦ãã¾ãã final class Generator implements Iterator { void rewind(); bool valid(); mixed current(); mixed key(); void next(); mixed send(mixed $value); } é¢æ°ãã¡ã½ããå®ç¾©ã®ãªãã® yield æã§æå®ããå¼ã¯ foreach ã«ã¼ãã§å±éããã¾ããããã«ãã£ã¦ Iterator ã¤ã³ã¿ã¼ãã§ã¤ã¹ãå®è£
ããã¯ã©ã¹ãç¨æããªãã¦ããä¸è¨ã®ã¤ãã¬ã¼ã¿ã®ã¡ã½ãããå©ç¨ããããAppendIterator ã MultipleIterator ã使ã£ã¦è¤æ°ã®ã¸ã§ãã¬ã¼ã¿ãã¾ã¨ãããªã©ãã¤ã
{{#tags}}- {{label}}
{{/tags}}