You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// InvalidArgument: Argument 2 of usort expects callable(string, string):int, but impure-callable(string, string, null|string=):(bool|int) provided
76
+
usort($a, "naive_version_compare");
77
+
```
78
+
79
+
The first usort succeeds, because psalm chooses the correct alias to use between the two provided in the callmap.
80
+
The second usort fails (equivalent to the non-split return type of `version_compare` inferred by reflection), because the return type is a union of the two possible signatures of version_compare.
81
+
82
+
When you have multifaceted functions like these, it's a very good idea to at least define a templated stub in `stubs/` for them, or a custom return type provider for even more complex logic, not representable with templates/conditional types/etc in a stub.
83
+
36
84
## Delta file format
37
85
38
86
Delta files (named `CallMap_<PHP major version><PHP minor version>_delta.php`)
0 commit comments