-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed as not planned
Labels
Description
Description
we are in the process of covering the handling of uasort when using with strnatcasecmp and found a few things which we are not able to make sense of. I also looked thru the docs and did not find something which explained what we see.
the problem occur arround strict-types and Stringable vs. string territory.
especially interessting is that strnatcasecmp when invoked directly behaves differently in comparison while using strnatcasecmp as callback via uasort. results vary with strict-types 0/1.
see
- https://3v4l.org/XgFEm#v8.3.30 (no error without declare)
- https://3v4l.org/slZeW#v8.3.30 (strnatcasecmp error with declare strict=1)
- https://3v4l.org/TdBcf#v8.3.30 (uasort doesn't error with declare strict=1)
- https://3v4l.org/AAlUE#v8.3.30 (uasort via arrow-fn using strnatcasecmp())
so our questions mainly are
- is all this expected behaviour?
- can someone share some insights so we can properly reflect php-src runtime behaviour in PHPStan?
thank you
PHP Version
PHP 8.3.x
Operating System
No response
Reactions are currently unavailable