• 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

ConstraintViolationListInterface to Exception in Symfony

Valet, Xdebug after reboot Big Sur not working

Laravel Database Strict Mode

Limit login attempts in Laravel 5.7

Boolean assignment operators in PHP

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

The sum of the user's points

Display a success custom notice after Placing an Order in WooCommerce

phpmyadmin : Depends: php-twig (>= 2.9) but 2.6.2-2 is to be installed. WHAT?

WordPress + Nginx on non-standard port behind AWS ELB results in broken links

How to override header set in Apache config with more specific header in a virtual host

Call to a member function fetch_field() on a non-object MySQLiDB

How to load Codeigniter 4 lang file into an array variable

PHP to search within txt file and echo the whole line

PHPExcel export HTML table to xlsx

About Contact Privacy policy Terms and conditions