-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[VarDumper] Support for intersection types #42099
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[VarDumper] Support for intersection types #42099
Conversation
derrabus
commented
Jul 14, 2021
Q | A |
---|---|
Branch? | 4.4 |
Bug fix? | yes |
New feature? | no |
Deprecations? | no |
Tickets | #41552 |
License | MIT |
Doc PR | N/A |
71f5490
to
bbe8260
Compare
Signed-off-by: Alexander M. Turek <me@derrabus.de>
bbe8260
to
3cf1057
Compare
types: array:2 [ | ||
0 => ReflectionNamedType { | ||
name: "Traversable" | ||
allowsNull: false | ||
isBuiltin: false | ||
} | ||
1 => ReflectionNamedType { | ||
name: "Countable" | ||
allowsNull: false | ||
isBuiltin: false | ||
} | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've decided to match the generated output for ReflectionUnionType
here. This is a bit verbose though because the sub-types of an intersection are guaranteed to be a ReflectionNamedType
with $allowsNull === false
and $isBuiltin === false
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, nullable intersection types are possible, see https://3v4l.org/aURFN/rfc#vgit.master
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh well. It's not like I haven't told them. 🤷🏻 php/php-src#6799 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The loophole was closed. php/php-src#7254
Thank you @derrabus. |