• 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

Display the default discounted price and percentage on Woocommerce products

Add record for each array elements if missing in table

Sum column values from multiple arrays

Inserting Country Selection into MySQL PHP [duplicate]

Laravel display validation error

Magento Installation SQLSTATE[HY000] [2002] No such file or directory error

CodeIgniter extend CI_URI undefined method

Insert multidimensional array to codeigniter cart

Nginx RTMP not recording

Why getting "Build step 'Execute shell' marked build as failure" error while creating a backup tar for files

Mysqli multi query error

How to create a scheduler application in php

Need to display only array value in JSON output

PHP: Print caught exception like Xdebug

Laravel Pagination links() not working

About Contact Privacy policy Terms and conditions