> Le 3 déc. 2020 à 22:05, Levi Morrison <[email protected]> a écrit :
>
> This is a long-standing behavior. Further, I don't know many people
> who want _more_ warnings in their codebase.
My guess is that this position was already discussed in the occasion of the
several past RFC whose main purpose was to introduce more
warnings/errors/exceptions? [1], [2], [3], etc. Apparently, many people do want
more warnings...
But my main point is not exactly that. It is inconsistency in behaviour, that
leads to wrong assumptions, that leads to incorrect code. As another example,
see the faulty `@is_file( $data ) === false` check mentioned in the other
thread [4].
Precisely (and I realise that maybe I wasn’t explicit enough in my message),
the issue is that `stat("non/existent/file")` raises a warning and returns
false, that leads to the wrong assumption that `stat($random_string)` raises a
warning whenever it returns `false` instead of an array, that leads to the
deceptive confidence that the `false` case will be always handled by the error
handler.
—Claude
[1]: https://wiki.php.net/rfc/counting_non_countables
<https://wiki.php.net/rfc/counting_non_countables>
[2]: https://wiki.php.net/rfc/notice-for-non-valid-array-container
<https://wiki.php.net/rfc/notice-for-non-valid-array-container>
[3]: https://wiki.php.net/rfc/magic-methods-signature
<https://wiki.php.net/rfc/magic-methods-signature>
[4]: https://externals.io/message/112333#112350
<https://externals.io/message/112333#112350>