private static function pop(\ArrayIterator $iterator): string
    {
        $current = $iterator->current();
        $iterator->next();

        return $current;
    }
private static function pop(\ArrayIterator $iterator): string
    {
        $current = $iterator->current();
        $iterator->next();

        return $current;
    }
private static function pop ( \ ArrayIterator $ iterator ) : string { $ current = $ iterator -> current ( ) ; $ iterator -> next ( ) ; return $ current ; }
Return current entry and moves the iterator to the next entry.

@param \ArrayIterator $iterator

@return string
Return current entry and moves the iterator to the next entry .