Skip to content

range can return strings #2378

@iluuu1994

Description

@iluuu1994
function takesString(string $s) {}

takesString(range('A', 'Z')[0]);

Parameter #1 $s of function takesString expects string, float|int given.

https://phpstan.org/r/89dbe414-2543-4c1d-a6b9-ba12f11566db

This should probably be implemented using a dynamic return type extension.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions