Our PHP 8.1 testing on GitHub Actions revealed a new deprecation in PHP 8.1:
Depending on the BC impact, we should either silence this warning explicitly or fix the usage.
The few implementations of __serialize() in extensions within php-src all return indexed arrays (e.g. ArrayObject). That appears in various userland implementations as well (e.g. Symfony's AbstractToken), but there are other examples of an implementation returning an associative array (e.g. Symfony's Route). The examples in the original RFC actually used associative arrays, so I assume the only requirement is that a class' own __serialize() and __unserialize() methods be consistent with each other.
In PHPC, I would prefer to use associative arrays since we already have helper functions to return such HashTables (currently used by get_debug_info and get_properties handlers). I assume the examples using indexed arrays are doing so for conciseness and to avoid serializing property names in the output; however, that design choice also means the serialization format is a bit more fragile since the order of fields becomes significant.