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. |
Beta Was this translation helpful? Give feedback.
5 replies
-
Presumably This function can potentially return |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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.
Beta Was this translation helpful? Give feedback.
All reactions