public function each($func, $params = []) { foreach ($this->_items as $key => $item) { $func = $func->bindTo(!is_object($item) ? (object) $item : $item); $res = $func($key, $item); $this->_items[$key] = $item; if ($res == self::DONE) { break; } } }