A little confusing thing when try to get something from a string using multi dim offset
| From: | \\R\\N | Date: | Thu, 15 May 2014 13:10:26 +0000 |
| Subject: | A little confusing thing when try to get something from a string using multi dim offset | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-74224@lists.php.net to get a copy of this message | ||
Hi guys,
I posted a topic on php.general when I had some problem on getting
something from a string using multi dim offset here:
http://news.php.net/php.general/323297.
Here is a TL;Summary version:
$data = 'here\'s some data';
In PHP 5.5 it will be:
var_dump(isset($data['string'])); === false
var_dump(isset($data['string'][0])); === true
Other bright people in php.general already explained how it happens, and
I get it. But before get use to it, I think I should post this to do some
... complain ... if you will.
It's confusing, I have to say. Because the isset($data['check']) is
false, so the isset($data['check'][0]) should be false too, theoretically,
but it's not.
Is any chance to get
var_dump(isset($data['string'])); === false
var_dump(isset($data['string'][0])); === false <--
?
Because it will be more intuitively right and make PHP more user
friendly.
Thank you.