Remix.run Logo
jofla_net 2 days ago

>It will happily accept string in a array of dates, for example.

Yeah theres a bunch of oddities that rear their head from time to time.

I've had one peculiar JSON de-serialize bug lately that really threw me for a while. I normally do the json_decode() with the second arg set true, which yields an assoc arr. This doesn't tell the whole story though. IF the key is numeric when decoding, PHP will make its key an int! and not a string like the rest. I'm guessing it does the equivalent of an is_numeric() check or something.

This yields an array with keys which could be ints and strings :/

Still for all its warts though it is a fantastically Frankenstein of a language!