Skip to content

incorrect type inference for idate('j') #13531

@claudepache

Description

@claudepache

Bug report

PR phpstan/phpstan-src#4321 is nice (thank you), but not perfect...

For instance, idate('j') yields int, not false, see: https://3v4l.org/eNWLu

More generally, the documentation at https://www.php.net/idate is incomplete, there are several other allowed characters among those listed at https://www.php.net/manual/datetime.format

/cc @vrana

Code snippet that reproduces the problem

https://phpstan.org/r/2367f216-6f2b-468f-87a0-00fd07ba5c52

Expected output

Dumped type: int

Did PHPStan help you today? Did it make you happy in any way?

No response

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