Update strpos docs with error handling details when offset exceeds length - #4959
Merged
Conversation
Added error handling information for offset parameter, after observing this un/underdocumented fatal in production. Note: Using the github web editor, I am not sure if I can pull a second file into this PR, so I may submit a second PR to handle `stripos`.
Added error handling information for offset parameter.
Document error for offset exceeding haystack length
Added error handling information for offset parameter.
Document error for exceeding offset length
Added error handling information for offset parameter.
Document error for offset exceeding haystack length
TimWolla
requested changes
Oct 27, 2025
TimWolla
left a comment
Member
There was a problem hiding this comment.
This is not correct. A ValueError will be thrown in these cases.
Contributor
Author
|
Ah, you're correct, thanks. I was operating on log output from a system that reclassified ValueError occurrences as |
beryllium
commented
Oct 27, 2025
beryllium
commented
Oct 27, 2025
beryllium
commented
Oct 27, 2025
beryllium
commented
Oct 27, 2025
beryllium
commented
Oct 27, 2025
beryllium
commented
Oct 27, 2025
Co-authored-by: Tim Düsterhus <timwolla@googlemail.com>
TimWolla
approved these changes
Oct 27, 2025
TimWolla
requested changes
Oct 27, 2025
TimWolla
left a comment
Member
There was a problem hiding this comment.
Ah, sorry. Incomplete suggestion. You'll also need <itemizedlist>. See:
Member
I suggest using a GitHub Codespace as a batteries-included online editor that allows you to easily edit multiple files in a single commit. |
TimWolla
requested changes
Oct 28, 2025
Crell
pushed a commit
to Crell/doc-en
that referenced
this pull request
Dec 15, 2025
…ngth (php#4959) * Update strpos.xml with error handling details Added error handling information for offset parameter, after observing this un/underdocumented fatal in production. Note: Using the github web editor, I am not sure if I can pull a second file into this PR, so I may submit a second PR to handle `stripos`. * Document error for offset exceeding haystack length Added error handling information for offset parameter. * Document error for exceeding offset length Added error handling information for offset parameter. * Document error for offset exceeding haystack length Added error handling information for offset parameter. * Apply suggestions from code review Co-authored-by: Tim Düsterhus <timwolla@googlemail.com> * Apply review suggestions * Remove csprng-specific html entity * Add invalid offset ValueError information to strrpos-related methods * Fix whitespace for strprpos error message info --------- Co-authored-by: Tim Düsterhus <tim@bastelstu.be>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added error handling information for offset parameter on
strpos,stripos,mb_strpos, andmb_stripos, after observing this un/underdocumented fatal in production.Note: Using the github web editor, so my apologies for the cluttered PR with so many extra merges. Hopefully it can be squash-merged if approved.