Why run the code without reporting warning or notice
$data = null;var_dump($data['name']);
Results:
null
Reply content:
Why run the code without reporting warning or notice
$data = null;var_dump($data['name']);
Results:
null
This is a very interesting question, check the information, php.net on the people raised
https://bugs.php.net/bug.php?id=68110
https://bugs.php.net/bug.php?id=54556
In the back of the page link to see the bird brother @laruence, I think it is best to answer this question, it is him.
$arr = false;var_dump($arr['foo']['bar']['baz']); // NULL
PHP Manual for the original problem:
I added this bug to Bugs.php.net
(https://bugs.php.net/bug.php?id=68110) However I made tests with
PHP4, 5.4 and 5.5 versions and all behave the same.
This, in my point of view, should is cast to an array type and throw
The same error.
This is, according to the documentation on this page, wrong.
From Doc: "Note:attempting to access an array key which have not been
Defined is the same as accessing any other undefined Variable:an
E_notice-level error message would be issued, and the result would be
NULL. "
Do you check the configuration of the php.ini or add error_reporting (-1) before the output?
Up up.