input: Write a function to convert a given string to a list of integers. The string is expected to contain comma-separated integer values. If the input is empty or invalid, the function should return an empty list.
  
  assert to_int_list("1,2,3,4")==[1, 2, 3, 4]
  assert to_int_list("10,20,30,40")==[10, 20, 30, 40]
  assert to_int_list("5,6,7")==[5, 6, 7]
  assert to_int_list("9,8,7,6")==[9, 8, 7, 6]
  assert to_int_list("")==[]
  assert to_int_list("invalid,input")==[]
output: def to_int_list(s):
      if not s:
          return []
      try:
          return [int(x) for x in s.split(',')]
      except ValueError:
          return []