Unexpected Keys In Array

no-email (Damien Seguy), Damien Seguy
Sun, 29 Oct 2023 00:00:00 +0000

It is possible to put 2 elements in a PHP array, find different 5 keys with array_key_exists or isset) and yet, still count 2 distinct elements (key wise).
The type-juggling for array keys is applied in every PHP features, to keep things easy to use.
This code is one rare way to show how it still leaks. Depending on the context, it might be very confusing.