There is an inconsistency in type inference when accessing an array value directly using a string key versus using a variable containing the same string key. The first method correctly infers the type of the value as a string, whereas the second method infers the type as mixed.
Description:
There is an inconsistency in type inference when accessing an array value directly using a string key versus using a variable containing the same string key. The first method correctly infers the type of the value as a string, whereas the second method infers the type as mixed.
Example: