• 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 excel maatwebsite 3.1 import, date column in excel cell returns as unknown format number. How to solve this?

The difference when using if statement true === something() vs something() === true [duplicate]

MongoDB Duplicate Documents even after adding unique key

Laravel database insert with combining array and string

CSV to PHP class properties

Jquery DataTables: Data not displaying in table via Ajax

Detect a fetch request in PHP

Ajax GET request fails in laravel 8

Open a popup box after receiving result from ajax

httpd.conf on Windows: can't locate API model structure `php8_module`

Reload parent page after submit in iframe

How to fix 'Data has already been sent to output, unable to output PDF file' in MPDF

array_key_exists(): The first argument should be either a string or an integer

Unable to Edit config.inc.php

If you intend you use SMTP, add your SMTP Code after this Line

About Contact Privacy policy Terms and conditions