-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Remove include "sanity check" to get better error #4474
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
Instead of rejecting directories / non-regular files early with a generic error, we should just accept them and error later when a read is attempted. This is more general and will generate a better error message.
I like this change. What's needed to merge it? |
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.
I think it makes sense. I guess this was probably optimization before opcache where those fstat calls would happen on each request but with opcache it doesn't matter that much. So better errors make more sense.
Zend/zend_language_scanner.l
Outdated
/* Still add it to open_files so the file_handle destruction logic works correctly. */ | ||
zend_llist_add_element(&CG(open_files), file_handle); |
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.
I see that this was already merged as part of other change ( 2f64844 ) so it should be removed from this PR.
It looks like we can't have this nice thing because windows. If I'm wrong about windows, anyone is welcome to open a new PR that deals with the difference (I'm unsure how, or if it's possible). |
Instead of rejecting directories / non-regular files early with
a generic error, we should just accept them and error later when a
read is attempted. This is more general and will generate a better
error message.