IteratorAggregate foreach迭代器

最后更新于:2022-04-02 02:26:29

[TOC] ## 实例 ``` class demo implements IteratorAggregate{ public function getIterator() { return new ArrayIterator(range(1,10)); } } $demo = new demo(); foreach ($demo as $k=>$v){ var_dump($v); } ```
';