• 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

How to remove from a multidimensional array all duplicate elements including the original?

Assign output of PHP function to a variable

Converting array to string and then back in PHP

Message: Set sys_temp_dir in your php.ini after installed composer

Use Python plotly chart in PHP

Fetch files from next cloud storage and display in Laravel website

PHP random string generator

PHP how to detect if running on arm64 cpu?

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

PHPUnit (Phar) Fatal Error Only When Test Fails

How should I get started using PHPUnit as a testing framework for a bunch of functions and classes I have already made?

SQL to convert multiple rows into a single row of variable length

How to use PHPCBF to fix one issue at a time?

(Cache::lock()) -> get() -- Under what conditions does it return false?

phpunit - mockbuilder - set mock object internal property

About Contact Privacy policy Terms and conditions