Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Exception Handling in PHP
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Frank Neff
November 06, 2014
Programming
140
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Exception Handling in PHP
A lightning Talk about exception handling best practices in PHP for one of our customers
Frank Neff
November 06, 2014
More Decks by Frank Neff
See All by Frank Neff
Principles of Object Orientation
frne
0
390
Symfony High Availability in the Cloud
frne
0
640
Symfony 3 [german]
frne
0
430
Solr für Volltext-Suche oder gleich als Datenbank Engine
frne
0
400
Plaing with Neo4j -[:USING]-> PHP
frne
0
480
PHP under the hood
frne
3
220
Other Decks in Programming
See All in Programming
Atomic Design, Enforced: Scaling Mobile Design Systems (next.app devCon / droidCon Berlin 2026)
steliosf
PRO
0
160
個人開発者よ、Honoを使え(おじさんver)
tanahiro2010
2
160
contenteditable と日本語入力に向き合う
colorful12
0
180
Kubernetes祭り #2 OP/ED
bells17
0
110
カツオ、ご期待ください
suneo3476
0
160
Turning Architecture into Unit Tests in the AI Era (NSSpain XIV)
steliosf
PRO
1
140
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.8k
Simple Storage Service(S3) is not simple
iwatsukayura
0
230
見えないものを探る要求要件定義に必要な基本的思考 / invisible-requirement-thinking
minodriven
15
8.1k
[ハンズオン]AIへの指示だけで「五目並べ」を作ってみよう
satoshi256kbyte
1
360
SREの越境 / SRE Collaboration
y0hgi
2
300
AI時代のコードレビューは人に向けるな、仕組みに向けろ
texmeijin
5
3.6k
Featured
See All Featured
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Balancing Empowerment & Direction
lara
6
1.3k
WCS-LA-2024
lcolladotor
0
860
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
How to Think Like a Performance Engineer
csswizardry
28
2.9k
How to Talk to Developers About Accessibility
jct
2
570
A Tale of Four Properties
chriscoyier
163
24k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
280
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
420
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
210
Transcript
try { Exception Handling in PHP } A brief introduction
Exception != Error
– 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.”
– 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”
Application Layers Presentation Business Data NoDatabaseConnectionException NoResultException EmptyResultException InvalidConfigurationException HTTP/404
HTTP/500
Example EVIL!
– Me “Because a DBAL does not know how to
handle an empty result… But the business logic does!”
Done right
Done right
Pass Exceptions through layers
Exceptions
DBAL
Repository
Controller
– OSS Development Wisdom “An API method should always return
an expected result or throw an exception.”
Thanks ;) frankneff.ch - @frank_neff - github.com/frne