by ars · 11y ago · 0 comments
Of course I manipulate the data - that's exactly what weak mode does, convert the strings into integers. I just don't see how doing the conversion myself manually helps anything.
> It throws an error in case you receive bad input, and as we all know you will receive bad input.
It does no such thing. (int) will simply turn bad input into a zero.
Yes.
I have no doubt you CAN do it, but most of the time you don't.
And since most of the time you are dealing with strings my question stands: Why do the conversion manually instead of letting the nice new feature do it for you.
If you did send everything as JSON you would be bypassing everything PHP does with form/url data to make things easier for you (for example arrays). That doesn't seem like a good engineering tradeoff.