input: Write a function to check if a string has matching parentheses. The function should use a stack to keep track of opening parentheses and pop them when a closing parenthesis is encountered. If the stack is empty at the end, return True indicating all parentheses are matched, otherwise return False.
  assert matching_paren("(()()())")==True
  assert matching_paren("())(")==False
  assert matching_paren("((()))")==True
  assert matching_paren("(()")==False
  assert matching_paren("")==True
output: def matching_paren(s):
      stack = []
      for char in s:
          if char == '(':
              stack.append(char)
          elif char == ')':
              if not stack:
                  return False
              stack.pop()
      return not stack