Why isn't my PHP exception working?
PHP Snippet 1:
<?php
namespace Foo\Bar;
try {
// ...
} catch (Exception $e) { // This is trying to catch Foo/Bar/Exception
// ...
}
PHP Snippet 2:
try {
// ...
} catch (\Exception $e) {
// ...
}
<?php
namespace Foo\Bar;
try {
// ...
} catch (Exception $e) { // This is trying to catch Foo/Bar/Exception
// ...
}
try {
// ...
} catch (\Exception $e) {
// ...
}