• 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

Laravel multi auth - Authentication user provider [] is not defined

Transform array, set each array element with parent key php

Can't find vendor/autoload.php for Ratchet

PHP | "The requested PHP extension bcmath is missing from your system."

Call authenticate manually in router middleware

Laravel 5 controller sending JSON integer as string

Creating command to backup MySql database in Laravel

I want to store data in new index as per my key in php [duplicate]

VB.NET WebRequest with PHP POST

I cannot create a auto generated date time in mysql workbench

Using array_intersect on a multi-dimensional array

Magento 2 - Controller returning blank page

Laravel PHP: multiple project run at the same time [closed]

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

Using Associative arrays

About Contact Privacy policy Terms and conditions