I’ve heard that you get an error if you try to access a key in a hash that doesn’t exist.
However, I seem to just get an empty string, or a null value.
Example:
<?php
$hash = array("abc" => 123,
"def" => 456
);
echo "a key that's in the hash: <" . $hash["abc"] . "><br />";
echo "a key that's not in the hash: <" . $hash["ghi"] . ">";
?>
The output is:
a key that's in the hash: <123>
a key that's not in the hash: <>
What’s going on here?
I’m using PHP v5.3.8.
You are probably hiding your notice errors (more info here).
Put this at the top of your script: