• 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

Laravel dosen't connect with Oracle

Query Optimization, changing the queries in the loop into a single processing query

WordPress Subquery returns more than 1 row on SELECT

Submitting a form with ajax in Wordpress

WordPress Security Standards want me to escape my html, but how to do it correctly?

Stop caching for PHP 5.5.3 in MAMP

MySQL - Connection failed: No route to host

How to insert Google Adsense Code in PHP script?

Extract string between first whitespace and last whitespace in php

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

How to create custom authentication in laravel 8?

Changing font color in javascript

Can I use a WooCommerce function without any WooCommerce page?

Adding reCAPTCHA v2 into my PHP file

How to convert a carbon into string, to take the date only?

About Contact Privacy policy Terms and conditions