This is one of the places where PHP makes me sad ... working around this problem always feels like a hack :/