public function findLastIndex(string $tagName) : int
    {
        $tags = $this->asArray();
        return ArrayUtils::lastIndexOf($tags, function (Tag $tag) use ($tagName) {
            return $tag->getTagName() === $tagName;
        });
    }
public function findLastIndex(string $tagName) : int
    {
        $tags = $this->asArray();
        return ArrayUtils::lastIndexOf($tags, function (Tag $tag) use ($tagName) {
            return $tag->getTagName() === $tagName;
        });
    }
public function findLastIndex ( string $ tagName ) : int { $ tags = $ this -> asArray ( ) ; return ArrayUtils :: lastIndexOf ( $ tags , function ( Tag $ tag ) use ( $ tagName ) { return $ tag -> getTagName ( ) === $ tagName ; } ) ; }
Finds index of a tag in the stack by tag name.

@param string $tagName

@return int Index of a tag if found, -1 otherwise.
Finds index of a tag in the stack by tag name .