Also, probably not relevant in practice, but one of those two is probably faster?
Also, probably not relevant in practice, but one of those two is probably faster?
Another is if you going to merge JSON data and send it further then an object can be easier because that is how the rest of the world views it.
However there many more array functions in the standard library than object functions.
I think it is generally easier to annotate arrays vs objects with phpdoc.
If this blog post is still true today when it was written (2018 PHP 7.2), then arrays are better for performance vs stdClass, but a real class is better than both, but sadly you can't JSON decode into a class directly.
https://steemit.com/php/@crell/php-use-associative-arrays-ba...
To prevent [] and {} from both being deserialized to an empty array.
defined object > dynamic object > array
But it's very much a micro-optimization.