• 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

php 7 php.ini upload_max_filesize not working

PDOException: PDO::__construct(): php_network_getaddresses: getaddrinfo failed: no such host known

Wordpress add responsive srcset header image to theme

Converting IPv6 to IPv4 address in PHP

In PHP, which is faster: preg_split or explode?

NGINX: connect() to unix:/var/run/php7.2-fpm.sock failed (2: No such file or directory)

Component install error: JInstaller: :Install: File does not exist

Laravel Schedule not sending email

MySQL/PHP - Web Based Game -User specific inventory table or 1 giant table? Another option?

Display the default discounted price and percentage on Woocommerce products

PHP random string generator

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

How to add a heading in between checkout fields of WooCommerce

Redis Command To Sort Keys

enable Apache http Authorization header

About Contact Privacy policy Terms and conditions