Replies: 2 comments 8 replies
|
PHPStan's BenevolentUnionType is mostly an implementation detail that's supposed to make some situations less annoying. It can't be expressed in a PHPDoc and it isn't notable to most users. |
5 replies
|
Presumably This function can potentially return |
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
the article at https://phpstan.org/blog/union-types-vs-intersection-types describes union and intersection types.
phpstan also has a benevolent union type - which I don't know what it specifics are.
it would be great if the article could mention the benevolent union type and would describe what the difference is between benevolent union and 'regular union'. maybe even show it with a small example?
if someone could give me some hints about the differences, I would also try to provide a PR to enhance the article.
All reactions