这里有一点问题, OuterIterator 应该是一个接口去实现,而不是去继承一个 Iterator 迭代器, 视频里更像是自己实现了一个 OuterIterator
2019-07-11
<?php //CountableClass.php
class CountMe implements Countable
{
protected $_myCount =3;
public function count(){
return $this->_myCount;
}
}
$obj = new CountMe();
echo $obj->count()."<br />";
echo count($obj)."<Br />";
?>
class CountMe implements Countable
{
protected $_myCount =3;
public function count(){
return $this->_myCount;
}
}
$obj = new CountMe();
echo $obj->count()."<br />";
echo count($obj)."<Br />";
?>
2018-04-09