public function closeTag($compiler, $expectedTag)
    {
        if (count($compiler->_tag_stack) > 0) {
            // get stacked info
            list($_openTag, $_data) = array_pop($compiler->_tag_stack);
            // open tag must match with the expected ones
            if (in_array($_openTag, (array) $expectedTag)) {
                if (is_null($_data)) {
                    // return opening tag
                    return $_openTag;
                } else {
                    // return restored data
                    return $_data;
                }
            }
            // wrong nesting of tags
            $compiler->trigger_template_error("unclosed {" . $_openTag . "} tag");
            return;
        }
        // wrong nesting of tags
        $compiler->trigger_template_error("unexpected closing tag", $compiler->lex->taglineno);
        return;
    }
public function closeTag($compiler, $expectedTag)
    {
        if (count($compiler->_tag_stack) > 0) {
            // get stacked info
            list($_openTag, $_data) = array_pop($compiler->_tag_stack);
            // open tag must match with the expected ones
            if (in_array($_openTag, (array) $expectedTag)) {
                if (is_null($_data)) {
                    // return opening tag
                    return $_openTag;
                } else {
                    // return restored data
                    return $_data;
                }
            }
            // wrong nesting of tags
            $compiler->trigger_template_error("unclosed {" . $_openTag . "} tag");
            return;
        }
        // wrong nesting of tags
        $compiler->trigger_template_error("unexpected closing tag", $compiler->lex->taglineno);
        return;
    }
public function closeTag ( $ compiler , $ expectedTag ) { if ( count ( $ compiler -> _tag_stack ) > 0 ) { // get stacked info list ( $ _openTag , $ _data ) = array_pop ( $ compiler -> _tag_stack ) ; // open tag must match with the expected ones if ( in_array ( $ _openTag , ( array ) $ expectedTag ) ) { if ( is_null ( $ _data ) ) { // return opening tag return $ _openTag ; } else { // return restored data return $ _data ; } } // wrong nesting of tags $ compiler -> trigger_template_error ( "unclosed {" . $ _openTag . "} tag" ) ; return ; } // wrong nesting of tags $ compiler -> trigger_template_error ( "unexpected closing tag" , $ compiler -> lex -> taglineno ) ; return ; }
Pop closing tag

Raise an error if this stack-top doesn't match with expected opening tags

@param object       $compiler    compiler object
@param array|string $expectedTag the expected opening tag names
@return mixed any type the opening tag's name or saved data
Pop closing tag