Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Exception Handling in PHP

Frank Neff
November 06, 2014

Exception Handling in PHP

A lightning Talk about exception handling best practices in PHP for one of our customers

Frank Neff

November 06, 2014
Tweet

More Decks by Frank Neff

Other Decks in Programming

Transcript

  1. – docs.oracle.com “An exception is an event, which occurs during

    the execution of a program, that disrupts the normal flow of the program's instructions.”
  2. – php.net/manual “When an exception is thrown, code following the

    statement will not be executed, and PHP will attempt to find the first matching catch block. If an exception is not caught, a PHP Fatal Error will be issued with an "Uncaught Exception ..." message”
  3. – Me “Because a DBAL does not know how to

    handle an empty result… But the business logic does!”
  4. – OSS Development Wisdom “An API method should always return

    an expected result or throw an exception.”