<?php //OuterIterator.php$array = ['value1','value2','value3','value4'];$outerObj = new OuterImpl(new ArrayIterator($array));foreach ($outerObj as $key => $value){ echo "++".$key."---".$value."<br />";}class OuterImpl extends ArrayIterator{ public function current(){ return parent::current()."_tail"; } public function key(){ return "Pre_".parent::key(); }?>
- 1 回答
- 0 关注
- 1149 浏览
添加回答
举报
0/150
提交
取消