• 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

Add rows to Single product Additional information table in WooCommerce 3.6

Laravel dosen't connect with Oracle

How to create a scheduler application in php

Upload a file Using PHP and JavaScript

Sum column values from multiple arrays

PHP sort array of objects by two properties

Reducing authentication calls on external API (Laravel 5.6)

How to write PHP in XSLT

Passing a boolean value from checkbox in Laravel form

How to add class name to an existing tag in php

How to delete old images from public folder on update using Laravel

Spam Filter in Contact Form

target [LaravelFortifyContractsRegisterViewResponse] is not instantiable

Fatal error: [] operator not supported for strings

How can I make Laravel return a custom error for a JSON REST API

About Contact Privacy policy Terms and conditions