• 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

Uncaught TypeError: Cannot read property 'length' of null when retrieving tags from wp

Star and Half Star Rating in Laravel

PHP's array_map including keys

CodeIgniter 3 is generating a session file on each request, why?

Zig-zag scan an N x N array

Laravel: Why is my variable not being set while it's in the construct function of the controller?

Creating live search with AJAX and CodeIgniter

How to send image,audio or video through the WhatsApp API - PHP

advanced custom fields wordpress custom class

Must be of the type array, null given,

Can I use a WooCommerce function without any WooCommerce page?

Auto increment id JSON

Transfer data between JavaScript and PHP through JSON

Read users and passwords from a txt file

WooCommerce Subscriptions: Remove role on cancelled subscription

About Contact Privacy policy Terms and conditions