Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
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
2
130
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
Share
More Decks by Frank Neff
See All by Frank Neff
Principles of Object Orientation
frne
0
320
Symfony High Availability in the Cloud
frne
0
620
Symfony 3 [german]
frne
0
420
Solr für Volltext-Suche oder gleich als Datenbank Engine
frne
0
350
Plaing with Neo4j -[:USING]-> PHP
frne
0
450
PHP under the hood
frne
3
220
Other Decks in Programming
See All in Programming
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
560
OSSとなったswift-buildで Xcodeのビルドを差し替えられるため 自分でXcodeを直せる時代になっている ダイアモンド問題編
yimajo
3
610
Fragmented Architectures
denyspoltorak
0
150
プロダクトオーナーから見たSOC2 _SOC2ゆるミートアップ#2
kekekenta
0
200
KIKI_MBSD Cybersecurity Challenges 2025
ikema
0
1.3k
CSC307 Lecture 03
javiergs
PRO
1
490
フルサイクルエンジニアリングをAI Agentで全自動化したい 〜構想と現在地〜
kamina_zzz
0
400
Architectural Extensions
denyspoltorak
0
280
Basic Architectures
denyspoltorak
0
660
[KNOTS 2026登壇資料]AIで拡張‧交差する プロダクト開発のプロセス および携わるメンバーの役割
hisatake
0
270
高速開発のためのコード整理術
sutetotanuki
1
390
そのAIレビュー、レビューしてますか? / Are you reviewing those AI reviews?
rkaga
6
4.5k
Featured
See All Featured
What does AI have to do with Human Rights?
axbom
PRO
0
2k
Code Review Best Practice
trishagee
74
20k
Unsuck your backbone
ammeep
671
58k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
65
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
930
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
0
1.9k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
Design in an AI World
tapps
0
140
Darren the Foodie - Storyboard
khoart
PRO
2
2.4k
Testing 201, or: Great Expectations
jmmastey
46
8k
Writing Fast Ruby
sferik
630
62k
New Earth Scene 8
popppiees
1
1.5k
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