phpQueryObject::next PHP Method

next() public method

First: main iterator interface method. Second: Returning next sibling, alias for _next(). Proper functionality is choosed automagicaly.
See also: phpQueryObject::_next()
public next ( $cssSelector = null ) : phpQueryObject | QueryTemplatesSource | QueryTemplatesParse | QueryTemplatesSourceQuery
return phpQueryObject | QueryTemplatesSource | QueryTemplatesParse | QueryTemplatesSourceQuery
    public function next($cssSelector = null)
    {
        //		if ($cssSelector || $this->valid)
        //			return $this->_next($cssSelector);
        $this->valid = isset($this->elementsInterator[$this->current + 1]) ? true : false;
        if (!$this->valid && $this->elementsInterator) {
            $this->elementsInterator = null;
        } elseif ($this->valid) {
            ++$this->current;
        } else {
            return $this->_next($cssSelector);
        }
    }