Re: 5.4 regression: non-existent sub-sub keys now have values
| From: | Yasuo Ohgaki | Date: | Thu, 24 Nov 2011 10:34:23 +0000 |
| Subject: | Re: 5.4 regression: non-existent sub-sub keys now have values | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-56564@lists.php.net to get a copy of this message | ||
2011/11/24 <devis@lucato.it>:
> On 24 November 2011 01:38, Stas Malyshev <smalyshev@sugarcrm.com> wrote:
> Hi,
>
> I hadn't the opportunity to install php 5.4 to test this, so I was
> wondering if someone could test how would this code behave ?
>
> ###########
> if (
> !isset( $widget_options['dashboard_incoming_links'] )
> || !isset( $widget_options['dashboard_incoming_links']['home'] )
> || $widget_options['dashboard_incoming_links']['home'] !=
> get_option('home') )
> ###########
>
> Is that correct saying that if the first condition is false the second
> will always be true ?
>
> Note: that's a piece of Wordpress
[yohgaki@dev php-src-5.4]$ ./php -r 'var_dump(!isset($a["a"]["a"]));'
bool(true)
[yohgaki@dev php-src-5.4]$ ./php -r '$a =
["a"=>["a"=>1]];var_dump(!isset($a["a"]), $a);'
bool(false)
array(1) {
["a"]=>
array(1) {
["a"]=>
int(1)
}
}
[yohgaki@dev php-src-5.4]$ ./php -r '$a =
["a"=>["a"=>1]];var_dump(!isset($a["a"]["a"]),
$a);'
bool(false)
array(1) {
["a"]=>
array(1) {
["a"]=>
int(1)
}
}
So it's not always true.
--
Yasuo Ohgaki
yohgaki@ohgaki.net