Skip to content

hrtime() result is always int on 64-bit #3650

@dktapps

Description

@dktapps

Bug report

hrtime() has a platform-dependent return type: on 32-bit, hrtime(true) returns float, but on 64-bit it returns int.

Code snippet that reproduces the problem

https://phpstan.org/r/b72181f9-ad67-4b9c-b201-43b362fff064

Expected output

No error.

Additional notes

It might be a good idea to read composer.json to check for php-64bit requirement, or have some phpstan.neon flag that allows specifying the arch, because this is not the only thing that has arch-dependent behaviour (for example https://phpstan.org/r/f64df3f6-d49d-4f09-b70a-f18e85182b8f).

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