Skip to content

Consider bcdiv's return type as string if divisior is not 0 #3551

@greg0ire

Description

@greg0ire

Feature request

Right now Phpstan is unhappy with this: https://phpstan.org/r/45d2d962-9ef2-451d-b121-de09a7421e43

(strlen(bcdiv('2','2',2));)

The docs say:

Returns the result of the division as a string, or NULL if divisor is 0.

It would be nice if phpstan could consider the return type as string and not string|null since I'm using '2' here.

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