Skip to content

Type::isSmallerThanOrEqual does not care about the PHP Version #11732

@VincentLanglet

Description

@VincentLanglet

Bug report

Since it might require a BC break, changing the signature to

public function isSmallerThanOrEqual(Type $otherType, PhpVersion $phpVersion): TrinaryLogic;

you might be interested about this (small ?) issue about releasing 2.0 @ondrejmirtes.

I assume the same issue exists for CompoundType::isGreaterThanOrEqual.

cc @staabm Since you worked a lot on looseComparison, you might be interested by this.

Code snippet that reproduces the problem

https://phpstan.org/r/1f376e9b-cd89-4869-839c-d1d64634353f

Expected output

I expect Comparison operation "<=" between 0 and '' is always true. for PHP 7.4- instead of always false.

Cf https://3v4l.org/qVgOX

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

PHPStan is an awesome tool, I love to use and love to try to improve (but I feel like finding bugs are way and way harder).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions