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
130
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
350
Symfony High Availability in the Cloud
frne
0
630
Symfony 3 [german]
frne
0
430
Solr für Volltext-Suche oder gleich als Datenbank Engine
frne
0
380
Plaing with Neo4j -[:USING]-> PHP
frne
0
470
PHP under the hood
frne
3
220
Other Decks in Programming
See All in Programming
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
0
260
LLM本来の能力を解き放つサンドボックス技術とAI民主化への適用
yukukotani
3
4.3k
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
6.6k
AIで効率化できた業務・日常
ochtum
0
140
Signal Forms: Details & Live Coding @enterJS 2026 in Mannheim
manfredsteyer
PRO
0
150
dRuby over BLE
makicamel
2
380
不変条件と整合性境界—ビジネスが決める設計判断と実現パターン / Invariants and Consistency Boundaries
nrslib
13
5.4k
技術記事、AIに書かせるか、自分で書くか? 〜それでも私が自分の手で書く理由〜 / #QiitaConference
jnchito
2
1.4k
コンテキストの使い捨てをやめる — ビジネスルール駆動開発と miko —
ioki
0
210
Oxlintのカスタムルールの現況
syumai
6
1.1k
セキュリティの専門家じゃなくてもできる。「セキュリティ意識」をアップデートして サプライチェーン攻撃への耐性を高めよう。
tk3fftk
5
850
TSKaigi Night Talks 2026_TypeScriptでサプライチェーンの整合性を型に閉じ込める
geekplus_tech
0
390
Featured
See All Featured
The Spectacular Lies of Maps
axbom
PRO
1
810
Practical Orchestrator
shlominoach
191
11k
Designing for humans not robots
tammielis
254
26k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
220
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
290
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.3k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
54k
Raft: Consensus for Rubyists
vanstee
141
7.5k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
3.5k
Mind Mapping
helmedeiros
PRO
1
250
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.4k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
250
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