Replace to_string with __toString