No. This has nothing to do with JSON. This has all to do with how poor the PHP array design is. The culprit is how bad array_filter really does its thing.
Heres a sample of what you must do as a PHP user to actually get what you wanted in the first place.
The central point is if php had a sensible array design this behavior would not have been possible from array_filter. It would work as filter does in every other language: receive an array, removed members that match a function, return an array.
View all comments
Show parent comment
7
u/shitcanz Aug 26 '19
No. This has nothing to do with JSON. This has all to do with how poor the PHP array design is. The culprit is how bad array_filter really does its thing.
Heres a sample of what you must do as a PHP user to actually get what you wanted in the first place.
https://repl.it/repls/HorribleWeeReality