News Feed
Sections




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

Brandon Savage's Blog:
Exceptional PHP Introduction to Exceptions
November 09, 2009 @ 10:12:52

In a new post to his blog Brandon Savage looks at exception handling in PHP with an introduction to a novice user of PHP:

Exceptions make it easy to interrupt program flow in the event that something goes wrong. They allow you to customize how a program handles errors, and gracefully degrades an application. This week, we will discuss various exception handling techniques, and today we will discuss the basic dos and don'ts for exceptions.

He starts with what exceptions are, how they should be used and a few handy tips that can help you make the most out of this handy PHP5 feature like:

  • Exceptions are not meant to be silenced
  • Use exception codes to differentiate between exceptions
  • Exceptions are meant to be handled
  • Don't use exceptions to manage normal program flow
  • Be sure that your exceptions honor layer abstraction
0 comments voice your opinion now!
exception tutorial introduction


blog comments powered by Disqus

Similar Posts

PHPMaster.com: Understanding the Factory Method Design Pattern

Mfana Ronald Conco's Blog: RabbitMQ and PHP Part 2 - Durable Queues and Persistent Messages

PHPMaster.com: Introduction to Git, Part 1

PHPBuilder.com: Developing a Ajax-driven Shopping Cart with PHP and Prototype

NetTuts.com: Setting Up a Local Mirror for Composer Packages With Satis


Community Events





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


release update interview deployment zendserver symfony laravel package install community api opinion introduction language podcast list framework series library tips

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