Why Array String Keys Are Not Type-Safe in PHP And What Will PHPStan Do About It:

https://phpstan.org/blog/why-array-string-keys-are-not-type-safe

Why Array String Keys Are Not Type-Safe in PHP

@OndrejMirtes Very relevant to my company! We store a lot of maps of ticker/CUSIP -> amount, then typehint tickers and CUSIPs as strings. All good except for the small percent of CUSIPs that are all numeric and get cast to an int. Every 6 months we hit an error with this and nothing automated helps. We even get sniffs saying '$key = (string)$key;' doesn't do anything. (Oh it does!) Thanks for the good work on this!