Skip to content

Promote warnings to errors in array_count_values() - #4580

Closed
Girgias wants to merge 1 commit into
php:masterfrom
Girgias:array-count-values-warning2error
Closed

Promote warnings to errors in array_count_values()#4580
Girgias wants to merge 1 commit into
php:masterfrom
Girgias:array-count-values-warning2error

Conversation

@Girgias

Copy link
Copy Markdown
Member

Split from #4566

@nikic

Copy link
Copy Markdown
Member

Not sure this change is appropriate: Note that this warning is really just a warning, not a proper error condition. The function is still going to count other values, and skip over those with unsupported types. The same is not possible if an exception is thrown.

@SjonHortensius

Copy link
Copy Markdown
Contributor

I agree, this might not be as straight-forward as it seems. The warning+result allows users to choose between failing and continuing. I only use codebases that convert all warnings to exceptions anyway but this change removes the option that other might choose (using the result even though a warning occured as illustrated by the testcase)

@krakjoekrakjoe closed this Aug 29, 2019
@Girgias
Girgias deleted the array-count-values-warning2error branch November 20, 2019 19:25
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@Girgias@nikic@SjonHortensius@krakjoe@kocsismate