Open StarringLara opened 1 year ago
I found these snippets:
Interesting!
The difference is that unset, isset, empty and print are listed in Callmap.php while include, require and die are not.
Considering we have special handling for about all of those, we don't get to the point where Psalm will have to check if the function exists, but if you add "\", Psalm special handling doesn't seem to trigger (which is coherent) and then it goes to check if we actually know the function (and we only do on some of those).
If you want, you could try dropping unset, isset, empty and print from the Callmap file to see if something break (I don't expect to)
In PHP, many language constructs commonly look like functions when called, even though they are not functions and really are language constructs. If you call these language constructs with a leading
\
as if using a fully qualified name for the function call, PHP will throw a "Call to undefined function" exception. In some cases, Psalm catches these calls to undefined functions, and in other cases it does not.https://psalm.dev/r/cbd5c874d3