• 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

virtctl works when executed via command line but not from php exec()

Edit XML in HTML form and submit to self

Best way to scrolldown onpageload

Split a string array into pieces

How to send image,audio or video through the WhatsApp API - PHP

Sentry on Symfony: how to exclude `NotFoundHttpException`

Chunk and transpose a flat array into rows with a specific number of columns

Laravel 5.1 xmlHttpRequest AJAX POST TokenMismatchException

Querying only one row from a one to many relationship laravel

How can I easily switch between PHP versions on Mac OSX?

MySQL upgrade causing unexpected results on simple WHERE clauses

Boolean assignment operators in PHP

Laravel 5 controller sending JSON integer as string

Apply filter array/return terms

add uri parameter to Route name in laravel

About Contact Privacy policy Terms and conditions