In PHP, I have error_reporting
set to report everything including notices.
Why does the following not throw any notices, errors or anything else?
$myarray = null;
$myvalue = $myarray['banana'];
Troubleshooting steps:
$myarray = array();
$myvalue = $myarray['banana'];
// throws a notice, as expected ?
$myarray = (array)null;
$myvalue = $myarray['banana'];
// throws a notice, as expected ?
$myarray = null;
$myvalue = $myarray['banana'];
// no notice or warning thrown, $myvalue is now NULL. ? Why?
It's possible it's a bug in PHP, or I'm just not understanding something about how this works.
There is an active bug report started at 2006.
And in documentation it is a notice about this in String section.