RemexHtml/TreeBuilder/TreeBuilder.php
public function generateImpliedEndTags( $name, $pos ) {
		$stack = $this->stack;
		$current = $stack->current;
		while ( $current && $current->htmlName !== $name &&
		  isset( self::$impliedEndTags[$current->htmlName] )
		) {
			$popped = $stack->pop();
			$this->handler->endTag( $popped, $pos, 0 );
			$current = $stack->current;
		}
	}
public function generateImpliedEndTags( $name, $pos ) {
		$stack = $this->stack;
		$current = $stack->current;
		while ( $current && $current->htmlName !== $name &&
		  isset( self::$impliedEndTags[$current->htmlName] )
		) {
			$popped = $stack->pop();
			$this->handler->endTag( $popped, $pos, 0 );
			$current = $stack->current;
		}
	}
public function generateImpliedEndTags ( $ name , $ pos ) { $ stack = $ this -> stack ; $ current = $ stack -> current ; while ( $ current && $ current -> htmlName !== $ name && isset ( self :: $ impliedEndTags [ $ current -> htmlName ] ) ) { $ popped = $ stack -> pop ( ) ; $ this -> handler -> endTag ( $ popped , $ pos , 0 ) ; $ current = $ stack -> current ; } }
Generate implied end tags, optionally with an element to exclude.

@param string|null $name The name to exclude
@param int $pos The source position
Generate implied end tags optionally with an element to exclude .