• 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 make Canonicals with PHP

Sum column values from multiple arrays

How to disable only_full_group_by option in Laravel

Creating command to backup MySql database in Laravel

How to create custom authentication in laravel 8?

Detect emoticons in string

how to remove white space in select 2

Access denied for user 'homestead'@'localhost' (using password: YES)

sqlsrv_num_rows() expects parameter 1 to be resource, boolean given

passwordless LDAP login and get user information using Kerberos ticket in PHP

Laravel Get Days In Month From Month Number?

What is PHP's equivalent of JavaScript's "array.every()"?

Fatal error: [] operator not supported for strings

Do I need to install `fxp/composer-asset-plugin` if I'm not doing front-end development

Ajax GET request fails in laravel 8

About Contact Privacy policy Terms and conditions