For some reason I always hit the echo command (go read it), even though an error is raised on the line before. This is weird as I explictly wrote that php should catch all errors. (the (Exception $e)
part)
What is happening, and how can I fix it?
$result = '';
for ($k=0; $k < (int)(mb_strlen($plaintext)/2); $k++) {
try {
$i = (strpos($key1, $plaintext[$k]) + $n) % $L1;
$temp = $key[$k]; // Assume an error will raise here
echo "Should never get here, as $key[$k] always should raise an error, as the key was not found
";
$result .= $temp;
} catch (Exception $e) { // (Exception $e) doesn't work either
$result .= $key1[$i];
};
};