Re: isset() and the new VM
| From: | Sara Golemon | Date: | Tue, 02 Nov 2004 21:13:51 +0000 |
| Subject: | Re: isset() and the new VM | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-13689@lists.php.net to get a copy of this message | ||
> isset($arr[0]['id']) used to return false if $arr[0] is undefined, but
> with the new VM it throws a warning.
>
> Is this new behavior or a bug ?
>
I'd call it bugish, since part of the point of isset() is that it's never
supposed to throw notices on undefined vars/indices.
[sarag@cinco php5]$ sapi/cli/php -r 'error_reporting(E_ALL|E_STRICT);
ini_set("display_errors", true); var_dump(isset($arr[0]));'
bool(false)
[sarag@cinco php5]$ sapi/cli/php -r 'error_reporting(E_ALL|E_STRICT);
ini_set("display_errors", true); var_dump(isset($arr[0][0]));'
Notice: Undefined variable: arr in Command line code on line 1
bool(false)