What are the best practices for handling exceptions in PHP to avoid conflicts with namespaces?

When handling exceptions in PHP to avoid conflicts with namespaces, it is important to fully qualify the exception class names to ensure they are correctly resolved within the appropriate namespace. This can be done by using the `use` keyword to import the exception class or by referencing the exception class using its fully qualified name when throwing or catching exceptions.

<?php

namespace MyNamespace;

use Exception;

try {
    // code that may throw an exception
    throw new Exception('An error occurred.');
} catch (Exception $e) {
    // handle the exception
    echo 'Caught exception: ' . $e->getMessage();
}