I say remove all safeguards in let php handle the the casting to string and throw error when required.