Skip to content

Consistent error handling for fgetcsv/fputcsv #6188

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
wants to merge 1 commit into from
Closed

Conversation

nikic
Copy link
Member

@nikic nikic commented Sep 22, 2020

Normalize the behavior between the file functions and those on
SplFileObject.

Be consistent about throwing regardless of whether the delimiter etc
is empty or has too many characters. I don't think it's worthwhile
to distinguish these cases.

Back when we looked into this originally, there was some hope that
we might want to add support for multiple-character delimiter etc,
but after a cursory look, I really don't think this is going to
happen (for fputcsv maybe, but for fgetcsv this just makes an
already broken function much more complicated.)

cc @Girgias @kocsismate @cmb69 from #5007.

Normalize the behavior between the file functions and those on
SplFileObject.

Be consistent about throwing regardless of whether the delimiter etc
is empty or has too many characters. I don't think it's worthwhile
to distinguish these cases.

Back when we looked into this originally, there was some hope that
we might want to add support for multiple-character delimiter etc,
but after a cursory look, I really don't think this is going to
happen (for fputcsv maybe, but fgetcsv is completely broken anyway).
@Girgias
Copy link
Member

Girgias commented Sep 22, 2020

Seems good on my end, I need to get back at working on the CSV extension which tries to sort some of this mess because when I looked at adding support it was rather complicated from what I remember.

Copy link
Member

@cmb69 cmb69 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

Regarding multi-character support for the parameters: I agree that we better leave these functions alone.

@kocsismate
Copy link
Member

LGTM for me too! :)

@php-pulls php-pulls closed this in 625d846 Sep 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants