需要继承 \Iterator,并且实现5个方法
迭代器模式,继承implement \iterator,实现接口里的方法
迭代器模式
类继承implements \Iterator
然后遍历修改
最后运行该方法
再运行这两个方法
先运行这两个方法
迭代器构造方法
$user->name;