It should be noted that many examples in the PHP documentation omit error and exception handling for clarity and brevity.
This does not mean that error handling should be omitted for production code
as it can lead to TypeErrors being thrown,
failure values being coerces, such as false
into an empty string,
or assumptions being violated which might cause difficult to track bugs.
Some extensions provide complete examples where error handling is included
to demonstrate correct usage of the various functions and methods provided
by the extension.