Skip to content

Promote warnings to errors in strpbrk() #4598

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

Conversation

Girgias
Copy link
Member

@Girgias Girgias commented Aug 22, 2019

Split from #4554

php_error_docref(NULL, E_WARNING, "The character list cannot be empty");
RETURN_FALSE;
zend_throw_error(NULL, "The character list cannot be empty");
return;
Copy link
Member

Choose a reason for hiding this comment

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

An alternative here would be to drop the warning instead and return false -- this is consistent with searching for an empty list of characters, which will never be found.

Not sure whether that's actually a good idea though.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't have a strong opinion in this, maybe let internals decide?

@Girgias
Copy link
Member Author

Girgias commented Aug 31, 2019

Should this be converted to an Error or dropped all together?

@Girgias
Copy link
Member Author

Girgias commented Nov 20, 2019

Ping @nikic, should I bring this up on internals?

@nikic
Copy link
Member

nikic commented Nov 20, 2019

@Girgias Let's go with the error for now. LG modulo switch to ValueError.

@Girgias Girgias force-pushed the strpbrk-errors2warnings branch from 99f15bd to af929c0 Compare November 20, 2019 22:36
@php-pulls php-pulls closed this in 501a72e Nov 21, 2019
@Girgias Girgias deleted the strpbrk-errors2warnings branch November 21, 2019 23:38
Sign up for free to 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