public function removeLast(string $tagName) : bool
    {
        $index = $this->findLastIndex($tagName);
        if ($index === -1) {
            return false;
        }

        $this->removeAt($index);
        return true;
    }
public function removeLast(string $tagName) : bool
    {
        $index = $this->findLastIndex($tagName);
        if ($index === -1) {
            return false;
        }

        $this->removeAt($index);
        return true;
    }
public function removeLast ( string $ tagName ) : bool { $ index = $ this -> findLastIndex ( $ tagName ) ; if ( $ index === - 1 ) { return false ; } $ this -> removeAt ( $ index ) ; return true ; }
Finds and removes last tag by tag name.

@param string $tagName

@return bool True if found, false otherwise.
Finds and removes last tag by tag name .