Skip to content

strpos() and stripos() changed behavior under 8.x that is not documented #1927

Open
@syntaxler

Description

@syntaxler

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Category: StringsbugDocumentation contains incorrect information

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions