• 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

Failing validation doesn't stop code execution in livewire component

retrieve data from database using session

Natural ORDER in Laravel Eloquent ORM

file_put_content...fail to open stream:Permission denied in Laravel 5

Can't find vendor/autoload.php for Ratchet

Insert database rows from columns of data from associative array of indexed arrays

PHP DOTENV unable to load env vars

how to sort by a custom appended relation to model

Extract house numbers from address string

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

How to get quarter for future date using Carbon?

How to override htaccees file for cache control header

PHPMetrics option --excluded-dirs="myfolder" : myfolder dir is not excluded within docker

I'm trying to use curl with php but getting this error:Could not resolve host: Bearer

Lexik JWT authentication problem "Invalid credentials"

About Contact Privacy policy Terms and conditions