-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
Union types #4838
Union types #4838
Conversation
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.
Only had time to go through the tests: huge work, nice!
a68c5eb
to
471931e
Compare
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.
Awesome work, thanks @nikic ❤️
Instead throw the generic invalid type message. Otherwise we may run into issues if a union type contains an invalid type, but also a valid one.
This is tricky...
Not sure if all of this is really worthwhile, but we can still drop it...
I'm going with a canonical type format here -- and I think we should move the rest towards this as well.
Class loading is no longer relevant here, so just test general behavior.
This reverts commit 476adfa.
My only question in retrospect is why wait for PHP 8? |
@strongholdmedia because 7.4 went feature freez around a year ago 😄 ( https://externals.io/message/106249 ) |
Sure, I do know that. :) |
Yes, there's no 7.5 :) |
The uttermost shame is that I am long since subscribed to the internals list, but I couldn't get myself to wade through the nonsense of the attached .eml forest that is a PITA to view :/ Perhaps it is just time to switch to the regular format from the digest stuff. |
> Union Types > > Support for union types has been added. Detect whether a type is a union type and throw an error if PHP < 8 needs to be supported. Ref: * https://wiki.php.net/rfc/union_types_v2 * https://www.php.net/manual/en/migration80.new-features.php#migration80.new-features.core.union-types * https://www.php.net/manual/en/language.types.declarations.php#language.types.declarations.composite.union * php/php-src#4838 * php/php-src@999e32b
> Union Types > > Support for union types has been added. Detect whether a type is a union type and throw an error if PHP < 8 needs to be supported. Ref: * https://wiki.php.net/rfc/union_types_v2 * https://www.php.net/manual/en/migration80.new-features.php#migration80.new-features.core.union-types * https://www.php.net/manual/en/language.types.declarations.php#language.types.declarations.composite.union * php/php-src#4838 * php/php-src@999e32b
> Union Types > > Support for union types has been added. Detect whether a type is a union type and throw an error if PHP < 8 needs to be supported. Ref: * https://wiki.php.net/rfc/union_types_v2 * https://www.php.net/manual/en/migration80.new-features.php#migration80.new-features.core.union-types * https://www.php.net/manual/en/language.types.declarations.php#language.types.declarations.composite.union * php/php-src#4838 * php/php-src@999e32b
Implementation for union types RFC.