Open mxr576 opened 1 month ago
strnatcasecmp
used differently.This is a really special edge case.
With declare(strict_types = 1);
:
strnatcasecmp(Foo::fromString('c'), Foo::fromString('b'))
crashuasort
is not crashingYou can reproduce the same behavior https://3v4l.org/DHEoB
PHPStan is working like you were using declare(strict_types = 1);
in every of your files ;
and here, I feel like it's more a "bug" with PHP which doesn't really respects the strict_types directive.
So I would say it's expected.
Bug report
This should be also an invalid report since uasort() supports sorting of stringable objects as well based on my testing.
https://3v4l.org/hkZjS
Code snippet that reproduces the problem
https://phpstan.org/r/e0e70f12-61aa-412a-9c1b-dcfa097cfa9d
Expected output
No error is reported.
Did PHPStan help you today? Did it make you happy in any way?
No response