public function hasTagged(int $tag): bool
    {
        // lazily build lookup map
        if (!isset($this->_taggedMap)) {
            $this->_taggedMap = [];
            foreach ($this->_elements as $element) {
                if ($element->isTagged()) {
                    $this->_taggedMap[$element->tag()] = $element;
                }
            }
        }
        return isset($this->_taggedMap[$tag]);
    }
public function hasTagged(int $tag): bool
    {
        // lazily build lookup map
        if (!isset($this->_taggedMap)) {
            $this->_taggedMap = [];
            foreach ($this->_elements as $element) {
                if ($element->isTagged()) {
                    $this->_taggedMap[$element->tag()] = $element;
                }
            }
        }
        return isset($this->_taggedMap[$tag]);
    }
public function hasTagged ( int $ tag ) : bool { // lazily build lookup map if ( ! isset ( $ this -> _taggedMap ) ) { $ this -> _taggedMap = [ ] ; foreach ( $ this -> _elements as $ element ) { if ( $ element -> isTagged ( ) ) { $ this -> _taggedMap [ $ element -> tag ( ) ] = $ element ; } } } return isset ( $ this -> _taggedMap [ $ tag ] ) ; }
Check whether the structure contains a context specific element with a
given tag.

@param int $tag Tag number
@return bool
Check whether the structure contains a context specific element with a given tag .