A Catchable Fatal Error
is not an Exception, it is an Error. It cannot be caught by a try/catch block, but by a custom error handler. See this answer for more info.
This line:
echo $qry; //invalid operation, I expect exception to be thrown
You are correct that it is invalid, but incorrect that an Exception is thrown. Unless an object has a valid __toString()
method defined, which PDOStatement does not, attempting to cast as a string will generate a PHP error, not an Exception. This is because the code attempting to cast the object to a string is part of the PHP core, and not some bit in a class somewhere.
If you want to look at the query contained in a PDOStatement object you need to access the read-only property $stmt->queryString
.