• 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 Nova Dependency Container what are the allowed resource properties other than id in dependsOn

WordPress ACFNotice: get_field() - We've detected one or more calls to retrieve ACF field values before ACF has been initialized

How to generate QR CODE for dynamic generating link and logo using Simple QrCode in laravel?

php 7 php.ini upload_max_filesize not working

Get data from accuweather api url

Redirect to previous page with php

Getting error: CodeIgniterDatabaseBaseResult::getResult in CodeIgniter

PHP Deprecated issue when running artisan command

Magento Installation SQLSTATE[HY000] [2002] No such file or directory error

How to MODIFY a Google Docs document via API using search-and-replace?

GuzzleHttp Hangs When Using Localhost

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

Limit of log line written to Apache Errorlog from mod php error_log

Converting alphabet letter to alphabet position in PHP [duplicate]

PHPExcel file download using AJAX call

About Contact Privacy policy Terms and conditions