Bug report
iterating an array of type array<string, string> in a foreach-loop changes the value (reference-type) from string to string|null when calling preg_replace and str_replace
Before phpstan v2.1.32, this code-snippet works very well.
Code snippet that reproduces the problem
https://phpstan.org/r/d9d2635b-2a08-4d46-8aa8-61314551c0f4
Expected output
array<string, string> should be shown in line 24
Did PHPStan help you today? Did it make you happy in any way?
I just couldn’t live without it anymore... ;o)
Bug report
iterating an array of type
array<string, string>in a foreach-loop changes the value (reference-type) fromstringtostring|nullwhen callingpreg_replaceandstr_replaceBefore phpstan v2.1.32, this code-snippet works very well.
Code snippet that reproduces the problem
https://phpstan.org/r/d9d2635b-2a08-4d46-8aa8-61314551c0f4
Expected output
array<string, string>should be shown in line 24Did PHPStan help you today? Did it make you happy in any way?
I just couldn’t live without it anymore... ;o)