-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
Labels
Description
Bug report
I get the error Cannot assign offset 'os' to array|string. and I shouldn't. Removing some preceding if statements makes the error disappear. The variable the assignment is happening on cannot be a string, but for some reason at some point during the parsing its type is changed to an union of string and array types
Code snippet that reproduces the problem
https://phpstan.org/r/2da96b3e-8592-43c3-8b04-c7dc4d45e331
This is the minimal example that I was able to achieve, but it doesn't reproduce the problem so it's pretty useless as is. I'm not able to get it working. However, analysing the Event.php file in getsentry/sentry-php you can see the error. Removing the if statements between lines 591 and 629 fixes the problem
Expected output
I don't expect any error on that line
Reactions are currently unavailable