public function has(int $idx, $expectedTag = null): bool
    {
        if (!isset($this->_elements[$idx])) {
            return false;
        }
        if (isset($expectedTag)) {
            if (!$this->_elements[$idx]->isType($expectedTag)) {
                return false;
            }
        }
        return true;
    }
public function has(int $idx, $expectedTag = null): bool
    {
        if (!isset($this->_elements[$idx])) {
            return false;
        }
        if (isset($expectedTag)) {
            if (!$this->_elements[$idx]->isType($expectedTag)) {
                return false;
            }
        }
        return true;
    }
public function has ( int $ idx , $ expectedTag = null ) : bool { if ( ! isset ( $ this -> _elements [ $ idx ] ) ) { return false ; } if ( isset ( $ expectedTag ) ) { if ( ! $ this -> _elements [ $ idx ] -> isType ( $ expectedTag ) ) { return false ; } } return true ; }
Check whether the structure has an element at the given index, optionally
satisfying given tag expectation.

@param int $idx Index 0..n
@param int|null $expectedTag Optional type tag expectation
@return bool
Check whether the structure has an element at the given index optionally satisfying given tag expectation .