Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Closed
divinity76 wants to merge 4 commits into php:master from divinity76:fix-file-flags-check

Conversation

Copy link
Contributor

@divinity76 divinity76 commented Jun 19, 2023
edited
Loading

the old flag check was flawed and would miss some invalid flags, for example:

file(__FILE__, FILE_APPEND);

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

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 
Copy link
Contributor Author

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 🤔

Copy link
Member

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 thinking

Only maintainers can re-run it. But it's fine, it's a known flaky test.

Copy link
Member

@iluuu1994 iluuu1994 left a 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).

Copy link
Contributor

staabm commented Jun 22, 2023

Just fyi: I borrowed the idea and implemented a check in PHPStan, so we can detect similar errors even on older PHP versions

phpstan/phpstan-src#2476

divinity76 reacted with thumbs up emoji

Copy link
Contributor Author

divinity76 commented Jun 22, 2023
edited
Loading

@iluuu1994 added note in UPGRADING (and that caused a merge conflict, but fixed it)

Copy link
Member

Thanks! Let's wait for Jakubs review since he's code owner.

Copy link
Member

Thanks @divinity76!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@bukka bukka bukka approved these changes

@iluuu1994 iluuu1994 iluuu1994 approved these changes

Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /