Re: [PATCH] Notice on array to string convertion
| From: | Tomas Creemers | Date: | Thu, 02 Jun 2011 14:39:56 +0000 |
| Subject: | Re: [PATCH] Notice on array to string convertion | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-52780@lists.php.net to get a copy of this message | ||
The choice between E_WARNING and E_NOTICE is simple if we look at the
definitions of the levels
(http://php.net/manual/en/errorfunc.constants.php).
E_NOTICE is defined as "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."
E_WARNING is defined as "Run-time warnings (non-fatal errors).
Execution of the script is not halted."
Since the code example provided by Marcel Esser (expecting a string as
a $_GET parameter but receiving an array) indicates that this
conversion is not neccesarlily an error (and E_WARNING is just a
non-fatal error), the conclusion is that this conversion should
trigger an E_NOTICE.
Best regards,
Tomas Creemers