-
Notifications
You must be signed in to change notification settings - Fork 7.8k
fix file() flags error-check #11483
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
fix file() flags error-check #11483
Conversation
the old flag check was flawed and would miss some flags, for example: file(__FILE__, FILE_APPEND); is invalid, but the old flags error check would miss it: https://3v4l.org/b2W9u
i think the ASAN_DEBUG_NTS test just randomly failed for completely unrelated reasons. anyone know how to re-run it? can't find a "re-run test" button 🤔 |
Only maintainers can re-run it. But it's fine, it's a known flaky test. |
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.
Thank you! This change makes sense to me. We'll need to document accordingly (in UPGRADING).
Just fyi: I borrowed the idea and implemented a check in PHPStan, so we can detect similar errors even on older PHP versions |
@iluuu1994 added note in UPGRADING (and that caused a merge conflict, but fixed it) |
Thanks! Let's wait for Jakubs review since he's code owner. |
Thanks @divinity76! |
the old flag check was flawed and would miss some invalid flags, for example:
is invalid, but the old flags error check would miss it: https://3v4l.org/b2W9u
the new check is also about 7% faster: https://quick-bench.com/q/j3k_unXcE91gVdTRH9Dm0nxpDUA