src/ChrisKonnertz/BBCode/BBCode.php
protected function popTag(array &$tags, $tag)
    {
        if (! isset($tags[$tag->name])) {
            return null;
        }

        $size = sizeof($tags[$tag->name]);

        if ($size === 0) {
            return null;
        } else {
            return array_pop($tags[$tag->name]);
        }
    }
protected function popTag(array &$tags, $tag)
    {
        if (! isset($tags[$tag->name])) {
            return null;
        }

        $size = sizeof($tags[$tag->name]);

        if ($size === 0) {
            return null;
        } else {
            return array_pop($tags[$tag->name]);
        }
    }
protected function popTag ( array & $ tags , $ tag ) { if ( ! isset ( $ tags [ $ tag -> name ] ) ) { return null ; } $ size = sizeof ( $ tags [ $ tag -> name ] ) ; if ( $ size === 0 ) { return null ; } else { return array_pop ( $ tags [ $ tag -> name ] ) ; } }
Returns the last tag of a given type and removes it from the array.

@param  Tag[]    $tags Array of tags
@param  Tag      $tag  Return the last tag of the type of this tag
@return Tag|null
Returns the last tag of a given type and removes it from the array .