Some notes about arrays in PHP over here: PHP: Frankenstein arrays. I was already aware of most of that but I thought the notes at the bottom about supporting JSON were handy:
If you want to enforce an array to encode to a JSON list (all array keys will be discarded), use:
And if you want to enforce an array to encode to a JSON object, use:
Also array_is_list is available as of PHP 8.1.