php面试题之二——数据结构和算法(高级部分)

2、数据结构和算法 1.使对象能够像数组同样进行foreach循环,要求属性必须是私有。(Iterator模式的PHP5实现,写一类实现Iterator接口)(腾讯) <?php class Test implements Iterator{ private $item = array('id'=>1,'name'=>'php'); public function rew
相关文章
相关标签/搜索