Raise E_NOTICE for null castings
| From: | Filippo Tessarotto | Date: | Fri, 27 Oct 2017 09:49:31 +0000 |
| Subject: | Raise E_NOTICE for null castings | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-100957@lists.php.net to get a copy of this message | ||
Hi, I would like to propose an RFC to raise an E_NOTICE when a variable "initialized" to null is casted to other types:
$foo = null;
var_dump($foo['bar']);
var_dump($foo . 'bar');
var_dump($foo + 2);
var_dump($foo & 2);
// At the time being, this code produces no errors
The eventual vote may be split one for each case.
What do you think?
Best regards, Filippo