-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Fix UPGRADING and #9556 "iterable" alias "array|Traversable" breaks PHP 8.1 code #9558
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
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.
Yeah, looks good to me. Thank you!
@cziegenberg, what do you think?
Yes, Looks good. Thanks! |
IMHO a redundancy should only be reported it one type is a strict subset of another, such as in |
Okay, I'll have another look as I basically stopped when I got to the point that I needed to modify a bunch of functions, but if the guideline is "only warn on strict subset" I can probably do some ground work in that direction which will make the type check redundancy easier to amend if/when we get type aliases |
b1c2609
to
e7fbe96
Compare
Turns out the fix is rather simple, just took me a long detour to get there, I maybe even should revert b7da08e as that's probably a pointless move too. |
As such a redundancy can only happen for union types
e7fbe96
to
91b25fd
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.
Seems reasonable
@@ -400,6 +400,10 @@ PHP 8.2 UPGRADE NOTES | |||
. CURL_VERSION_UNICODE (libcurl >= 7.72.0) | |||
. CURL_VERSION_ZSTD (libcurl >= 7.72.0) | |||
|
|||
- DBA |
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.
Unrelated?
function test(): (A&B)|object {} | ||
|
||
?> | ||
===DONE=== |
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.
===DONE=== is kinda pointless, since Fatal error
indicates termination. It's also used inconsistently.
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.
That ===DONE===
has been used in the past to easily see segfaults (which may not have been reported), but this is indeed obsolete since we now report any unexpected exit ("Termsig") on all platforms. However, according to https://qa.php.net/write-test.php#lastbit, there is another use case, and it seems this is still supported by run-tests.php. Still, without any code following ===DONE===
, there's no need to use it. (And frankly, I doubt that ===DONE===
is actually useful for that purpose.)
This kinda address #9556 by making it a documentation issue, and adds tests to verify the behaviour.