• 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

How to read laravel_session cookies saved in cookie memory of browser in client side?

Laravel 5.1 how to use {{ old('') }} helper on blade file for radio inputs

I want to use codeigniter foreign character library in my custom PHP project how i can use it?

phpunit - mockbuilder - set mock object internal property

How to give apache permission to write to home directory?

HTML and PHP in one file

Access denied for user 'homestead'@'localhost' (using password: YES)

Symfony process run throws exception - executing on command line works

Yoast SEO (WordPress Plugin) - Get plugin generated data manually

PHP array stringify

Laravel Displaying image from database

Currently Using CodeIgniter Framework i have an Error

Laravel 8 factory state afterCreating

Check if string contains a value in array [duplicate]

How to convert time from one timezone to another in PHP

About Contact Privacy policy Terms and conditions