News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Quinton Parker's Blog:
Try-catch suppress?
March 20, 2009 @ 07:56:13

In this new entry to his blog Quinton Parker looks at some strangeness he's found around the try/catch functionality in PHP. His specific example involves file_get_contents.

PHP never ceases to amaze me. Just the other day a colleague discovered that you can suppress error messages reported by file_get_contents() using the try-catch statement. That should've raised an eyebrow.

His sample code shows the normal error that a file_get_contents on a nonexistent file would give then wraps it in a try/catch. The same path is put into the file_get_contents but, because of some sort of interesting handling, isn't reported in the catch. He's at a loss and is asking for help figuring this one out from the readers out there. Be sure to leave a comment if you have more info.

0 comments voice your opinion now!
try catch exception handling supress filegetcontents


blog comments powered by Disqus

Similar Posts

PHPit.net: How to handle those pesky errors in PHP

PHP-Coding-Practices.com: Try-Catch Syntax Weirdness

PHP Developer Blog: Unit Tests: How to test for Exceptions

JetBrains.com: Just-In-Time debugging and PHP Exception Breakpoints with PhpStorm and Xdebug

Lukas Smith's Blog: Query parameter handling in Symfony2


Community Events

Don't see your event here?
Let us know!


framework video laravel5 unittest conference library development language opinion community introduction release api extension podcast series laravel psr7 interview voicesoftheelephpant

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework