• 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

Unable to run composer install

Display a success custom notice after Placing an Order in WooCommerce

Cannot pass null argument when using type hinting

How can I create a Download Page with post php method?

Zig-zag scan an N x N array

Cannot retrieve error message using Symfony HttpClient if the response is not "ok"

php retrieve specific data onclick from database in a list format

500 Internal Server Error on Ajax request. Not sure the origin of the problem

Whats the point of running Laravel with the command 'php artisan serve'?

Display the WooCommerce product price inside a custom function

Display a product custom field only in WooCommerce Admin single orders

What is my SQL missing?

PHPUnit (Phar) Fatal Error Only When Test Fails

Yii2: How to download backup files using spanjeta/yii2-backup?

How do I truncate a decimal in PHP?

About Contact Privacy policy Terms and conditions