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
check "never" return type more strictly #8599
Conversation
kkmuffme
commented
Oct 17, 2022
•
edited
edited
- require explicit "never" return type when function always exits
- error if function does not exit, but return type explicitly contains "never"
- Fix: Missing InvalidReturnType check when exit; #8175
- Fix: InvalidReturnType due to void and null not treated the same #8178
3b3cf85
to
aa9f4dc
Compare
I'm sure this will cause some followup issues to be created at some point in the future with PHP 8.1+, but I'll fix those once they actually pop up (and not for some synthetic examples we make up now) |
975dbb6
to
c64c4ac
Compare
I'm not sure I followed the actual changes yet. However, a few points first:
|
I need to wait until v5 is released before I can provide a PR on master/v5 branch, so we'll just put it on hold until then I guess |
You can already retarget it on master right now :) |
I can't bc we use this PR internally in our CI |
* require explicit "never" return type when function always exits * error if function does not exit, but return type explicitly contains "never" * Fix: vimeo#8175
previous PHP versions could give a fatal error in some cases, e.g. https://3v4l.org/ZRZZE
as this function needs a complete overhaul at some point in v5 - not doing this now, as it will just create conflicts with v5
520d9d0
to
81804bb
Compare
v5 see #8624 |