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
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
330
Symfony High Availability in the Cloud
frne
0
630
Symfony 3 [german]
frne
0
420
Solr für Volltext-Suche oder gleich als Datenbank Engine
frne
0
370
Plaing with Neo4j -[:USING]-> PHP
frne
0
460
PHP under the hood
frne
3
220
Other Decks in Programming
See All in Programming
Claude Codeログ基盤の構築
giginet
PRO
7
3.7k
2026-03-27 #terminalnight 変数展開とコマンド展開でターミナル作業をスマートにする方法
masasuzu
0
200
Angular-Apps smarter machen mit Gen AI: Lokal und offlinefähig - Hands-on Workshop!
christianliebel
PRO
0
140
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
1.1k
PHPで TLSのプロトコルを実装してみる
higaki_program
0
500
Smarter Angular mit Transformers.js & Prompt API
christianliebel
PRO
1
100
Linux Kernelの1文字のミスで 権限昇格ができた話
rqda
0
2.2k
Java 21/25 Virtual Threads 소개
debop
0
280
Vuetify 3 → 4 何が変わった?差分と移行ポイント10分まとめ
koukimiura
0
200
OTP を自動で入力する裏技
megabitsenmzq
0
130
車輪の再発明をしよう!PHP で実装して学ぶ、Web サーバーの仕組みと HTTP の正体
h1r0
2
410
どんと来い、データベース信頼性エンジニアリング / Introduction to DBRE
nnaka2992
1
340
Featured
See All Featured
How GitHub (no longer) Works
holman
316
150k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.4k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
310
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Designing Experiences People Love
moore
143
24k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
68
38k
The Invisible Side of Design
smashingmag
302
51k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
650
How to Talk to Developers About Accessibility
jct
2
160
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
120
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
64
54k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
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