When I try to access an array by key which is not exists in this array, php will raise \"undefined index\" notice error. When I try to do the same on strings, \"Illegal stri
It's sad, but it's documented behaviour.
http://php.net/manual/en/language.types.string.php
Note: Accessing variables of other types (not including arrays or objects implementing the appropriate interfaces) using [] or {} silently returns NULL.
Note:
Accessing variables of other types (not including arrays or objects implementing the appropriate interfaces) using [] or {} silently returns NULL.