public function is($selector)
    {
        if ($this->length > 0) {
            if (\is_callable($selector)) {
                foreach ($this->nodes as $index => $node) {
                    if ($selector($node, $index)) {
                        return true;
                    }
                }
            } else {
                $selection = self::create($this->document)->find($selector);

                foreach ($selection->nodes as $result_node) {
                    foreach ($this->nodes as $node) {
                        if ($result_node->isSameNode($node)) {
                            return true;
                        }
                    }
                }
            }
        }

        return false;
    }
public function is($selector)
    {
        if ($this->length > 0) {
            if (\is_callable($selector)) {
                foreach ($this->nodes as $index => $node) {
                    if ($selector($node, $index)) {
                        return true;
                    }
                }
            } else {
                $selection = self::create($this->document)->find($selector);

                foreach ($selection->nodes as $result_node) {
                    foreach ($this->nodes as $node) {
                        if ($result_node->isSameNode($node)) {
                            return true;
                        }
                    }
                }
            }
        }

        return false;
    }
public function is ( $ selector ) { if ( $ this -> length > 0 ) { if ( \ is_callable ( $ selector ) ) { foreach ( $ this -> nodes as $ index => $ node ) { if ( $ selector ( $ node , $ index ) ) { return true ; } } } else { $ selection = self :: create ( $ this -> document ) -> find ( $ selector ) ; foreach ( $ selection -> nodes as $ result_node ) { foreach ( $ this -> nodes as $ node ) { if ( $ result_node -> isSameNode ( $ node ) ) { return true ; } } } } } return false ; }
Check if any node matches the selector

@param string|self|callable|\DOMNodeList|\DOMNode $selector

@return boolean
Check if any node matches the selector