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
320
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
360
Plaing with Neo4j -[:USING]-> PHP
frne
0
450
PHP under the hood
frne
3
220
Other Decks in Programming
See All in Programming
Agentic AI: Evolution oder Revolution
mobilelarson
PRO
0
110
あなたはユーザーではない #PdENight
kajitack
4
340
Rで始めるML・LLM活用入門
wakamatsu_takumu
0
170
モジュラモノリスにおける境界をGoのinternalパッケージで守る
magavel
0
3.5k
AIコーディングの理想と現実 2026 | AI Coding: Expectations vs. Reality 2026
tomohisa
0
1.2k
CSC307 Lecture 15
javiergs
PRO
0
230
New in Go 1.26 Implementing go fix in product development
sunecosuri
0
380
受け入れテスト駆動開発(ATDD)×AI駆動開発 AI時代のATDDの取り組み方を考える
kztakasaki
2
540
守る「だけ」の優しいEMを抜けて、 事業とチームを両方見る視点を身につけた話
maroon8021
3
390
DSPy入門 Pythonで実現する自動プロンプト最適化 〜人手によるプロンプト調整からの卒業〜
seaturt1e
1
600
nuget-server - あなたが必要だったNuGetサーバー
kekyo
PRO
0
200
AI活用のコスパを最大化する方法
ochtum
0
120
Featured
See All Featured
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.1k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
270
Everyday Curiosity
cassininazir
0
150
Imperfection Machines: The Place of Print at Facebook
scottboms
269
14k
Technical Leadership for Architectural Decision Making
baasie
3
280
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.2k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.1k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
260
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.8k
Being A Developer After 40
akosma
91
590k
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