Skip to content

str_repeat(): Argument #2 ($times) must be greater than or equal to 0 #1558

@anthonyeden

Description

@anthonyeden

From manual page: https://php.net/function.str-repeat


On PHP 8, calling str_repeat with arg #2 < 0 throws this exception:

PHP Fatal error:  Uncaught ValueError: str_repeat(): Argument #2 ($times) must be greater than or equal to 0

The docs do not currently reflect this. They currently state "If the times is set to 0, the function will return an empty string.".

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