Strange behavior with isset () returning true for an array key that does not exist


I have the following array called $fruits:

    [response] => Array
            [errormessage] => banana

    [blah] => Array
            [blah1] => blahblah1
            [blah2] => blahblah2
            [blah3] => blahblah3
            [blah4] => blahblah4


Yet when I do:


It returns true!

What on earth would cause such a strange behavior and how can I fix this?


[n] is also a way to access characters in a string:

$fruits['response']['errormessage'][0] // cast to int
b (the first character, at position 0) of 'banana'

Use array_key_exists, possibly in combination with is_array.