• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

Why isn't my PHP exception working?

phpexception-handling


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) {
    // ...
}

Related Snippets

(Cache::lock()) -> get() -- Under what conditions does it return false?

run a query using EXECUTE BLOCK to prepair a column for an unique-Index

virtctl works when executed via command line but not from php exec()

Message: Set sys_temp_dir in your php.ini after installed composer

"properties should not be accessed directly" issue during WooCommerce 3.0 checkout

How do I refresh a DIV content?

Return new collection without modifying original collection

SMTP "Error: DATA not accepted from server!" Opencart 2.3 on InMotionHosting

Laravel: Create morphs() relationship nullable

PHPUnit 7: Failed asserting that exception of type InvalidArgumentException is thrown

Laravel phpunit test failing authorization

dompdf and img tag, image wont show

Laravel s3 upload file with metadata using pre-signed url

file_put_content...fail to open stream:Permission denied in Laravel 5

backup files to google drive using PHP

About Contact Privacy policy Terms and conditions