What would you expect for this script to output?
error_reporting(E_ALL); ini_set('display_errors',1); $text = "abc"; var_dump(isset($text['key'])); var_dump((bool) $text['key']);
Maybe a notice? maybe some false there..
But if you have in mind PHP logic.. you surely know..
So, $text is a string and string characters can be accessed with $text this is “b”
Then if you try $text[‘key’] PHP will typecast your ‘key’ to an integer (0) then $text exists!
The second step is simple.. $text is “a” and PHP logic again – any non empty string is true!