Re: [RFC] Reclassifying engine warnings
| From: | Aegir Leet via internals | Date: | Thu, 29 Aug 2019 13:02:02 +0000 |
| Subject: | Re: [RFC] Reclassifying engine warnings | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-106797@lists.php.net to get a copy of this message | ||
I know what the manual says about notices. But I don't agree with interpreting "could
happen in the normal course of running a script" as "it's perfectly fine if this part
of your code triggers a notice consistently and every time it goes down this particular code
path". Rather, I've always interpreted this as "under certain, rare, unforeseen
circumstances, your code could generate a notice here, probably because of something that is outside
of your control".
That's how I've always treated them at least.
Regardless of the exact semantics, don't you think a program that generates a constant stream
of notices is a bit strange? That sounds like something everyone would naturally want to avoid. You
don't drive your car with the check engine light permanently on and say "this is
fine", right?
On 29.08.19 14:43, Claude Pache wrote:
Le 29 août 2019 à 13:33, Aegir Leet via internals <internals@lists.php.net<mailto:internals@lists.php.net>> a écrit :
I'm sorry, but if you seriously believe doing something that generates a
notice (or warning, or error, ...) is not a bug - you're delusional.
No, what you think is not at all how notices were designed. From the manual
(https://www.php.net/errorfunc.constants):
E_NOTICE — Run-time notices. Indicate that the script encountered something that could indicate
an error, but could also happen in the normal course of running a script.
One can discuss whether unitialised variables should trigger a notice or a warning. But let us
respect the semantics of the language features.
—Claude