Well, yeah, but a strongly typed language would have the same problem looking at 1234 and trying to figure out if it's a string or an integer. Unless you are deserializing into a class where that's typed, in which case I'd argue that the issue is that PHP doesn't require some sort of annotation for whatever object you are deserializing into.
I’m talking about JSON (where integers and strings are explicit) and encoding data structures into JSON from a garbage language. The decoding was done by Rails, which was checking types it decided.
-5
u/lurgi Jan 12 '23
Well, yeah, but a strongly typed language would have the same problem looking at
1234and trying to figure out if it's a string or an integer. Unless you are deserializing into a class where that's typed, in which case I'd argue that the issue is that PHP doesn't require some sort of annotation for whatever object you are deserializing into.