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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Frank Neff
November 06, 2014
Programming
130
2
Share
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
460
PHP under the hood
frne
3
220
Other Decks in Programming
See All in Programming
TSKaigi2026-静的解析への投資がAI時代のコード品質を支える ── カスタムESLintルールの設計と運用
hayatokudou
6
1.3k
さぁV100、メモリをお食べ・・・
nilpe
0
110
肥大化するレガシーコードに立ち向かうためのインターフェース分離と依存の逆転 / JJUG CCC 2026 Spring
hirokunimaeta
0
230
Zod v4 Codec でスキーマに型変換を埋め込む REST API 設計 #TSKaigi2026
ryutaro_yako
0
170
iOS26時代の新規アプリ開発
yuukiw00w
0
220
サーバーレスで作る、動画データ管理基盤
oyasumipants
0
320
AIエージェントの隔離技術の徹底比較
kawayu
0
440
AIとRubyの静的型付け
ukin0k0
0
450
次世代リンターで探る、tsgo 時代における型認識カスタムルールの現実解
ytakahashii
3
1.3k
TSKaigi 2026 TypeScriptバックエンドのオブザーバビリティ戦略 — Datadog × NestJSの実践
taiseiyamamotoan
1
210
JavaDoc 再入門
nagise
0
210
[KCD Czech] eBPF Meets the GPU: Future of AI Infra Observability
doniacld
0
120
Featured
See All Featured
The SEO identity crisis: Don't let AI make you average
varn
0
480
Between Models and Reality
mayunak
4
320
Designing for Timeless Needs
cassininazir
1
240
The Curse of the Amulet
leimatthew05
1
13k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
190
Paper Plane (Part 1)
katiecoart
PRO
0
8.1k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.8k
Context Engineering - Making Every Token Count
addyosmani
9
920
GitHub's CSS Performance
jonrohan
1033
470k
The Pragmatic Product Professional
lauravandoore
37
7.3k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
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