• 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

Required field only if another field has a value, must be empty otherwise

How to get variable from JavaScript to PHP [duplicate]

Problems getting instance of UploadedFile in Yii2

how to redirect the user back to desired URL after login page in PHP?

Docker & Laravel : configure: error: Package requirements (oniguruma) were not met

Why the name of trucks are same in 2nd and 3rd record of company data retrieval?

How to convert the int value to inch in PHP [closed]

WHM Enabling mod_rewrite

Two buttons one form

Xdebug can't connect back to Docker host

WooCommerce Subscriptions: Remove role on cancelled subscription

Laravel UUID generation

Laravel 5.2: Unable to locate factory with name [default]

How do I set the maximum php memory limit

How can i call a function that executes an fpdf based on the choice of a form selector?

About Contact Privacy policy Terms and conditions