Skip to content

mb_strcut with $length as null #3667

@balazscsaba2006

Description

@balazscsaba2006

Bug report

Calling mb_strcut with the third parameter $length as null currently reports an error, that it should be int. According to the PHP documentation (If omitted or NULL is passed, extract all bytes to the end of the string), it supports also null.

Any ideas on how could I fix this?

Code snippet that reproduces the problem

Reproducer here: https://phpstan.org/r/01bc9ce6-2769-4987-a5d8-940b73e30130

Expected output

PHPStan should not report any errors if passing null as $length.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions