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
Kotlin Multiplatform Meetup - Compose Multiplatform 외부 의존성 아키텍처 설계부터 운영까지
wisemuji
0
190
Patterns of Patterns
denyspoltorak
0
1.4k
AI前提で考えるiOSアプリのモダナイズ設計
yuukiw00w
0
220
Amazon Bedrockを活用したRAGの品質管理パイプライン構築
tosuri13
4
250
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
450
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
120
Package Management Learnings from Homebrew
mikemcquaid
0
210
CSC307 Lecture 04
javiergs
PRO
0
660
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
190
SourceGeneratorのススメ
htkym
0
190
AI & Enginnering
codelynx
0
110
責任感のあるCloudWatchアラームを設計しよう
akihisaikeda
3
160
Featured
See All Featured
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
RailsConf 2023
tenderlove
30
1.3k
Facilitating Awesome Meetings
lara
57
6.7k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
430
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
66
36k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
150
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
170
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
117
110k
Docker and Python
trallard
47
3.7k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
96
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