• 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 load Codeigniter 4 lang file into an array variable

woocommerce get_order_report_data to show order_item_id

Dropzone: Submit both form data and dropzone at once

How to access a var with "-" in PHP [duplicate]

MySQL - Connection failed: No route to host

PHP error: "The zip extension and unzip command are both missing, skipping."

Laravel 8 Multiple Relationships for Factory

Don't show recurring price for WooCommerce subscriptions worth 0$

PHP and WebView - Cookie doesn't are the same

Laravel database insert with combining array and string

WordPress Subquery returns more than 1 row on SELECT

how to pass row id in href of a tag in codeigniter controller?

Laravel Model save() & update() Not Saving

How to KeyBy where multiple items have the same key

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

About Contact Privacy policy Terms and conditions