strpos() and stripos() changed behavior under 8.x that is not documented
Nobody has claimed this yet.
- Dominant language
- XML
- Stars
- 596
- Forks
- 890
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 55
Description
While porting code to php 8.1 I have noticed that strpos() and stripos() return index 0 under php 8.x when searching for the empty string "" as needle in any haystack, while 7.x returned false under this circumstances. As far as I have seen this is not mentioned in the documentation of these functions, and also not in https://www.php.net/manual/en/migration80.incompatible.php
This change in behavior breaks code, please add it to the documentation.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the strpos() and stripos() documentation entries and review the migration80.incompatible.php page mentioned in the issue. Compare their current notes with the reported PHP 7 and PHP 8 behavior; done means the changed empty-string behavior is documented in the relevant function reference and migration documentation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100