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
290
Symfony High Availability in the Cloud
frne
0
560
Symfony 3 [german]
frne
0
420
Solr für Volltext-Suche oder gleich als Datenbank Engine
frne
0
320
Plaing with Neo4j -[:USING]-> PHP
frne
0
420
PHP under the hood
frne
3
210
Other Decks in Programming
See All in Programming
人には人それぞれのサービス層がある
shimabox
3
670
ReadMoreTextView
fornewid
1
410
統一感のある Go コードを生成 AI の力で手にいれる
otakakot
0
3k
FormFlow - Build Stunning Multistep Forms
yceruto
1
170
複数アプリケーションを育てていくための共通化戦略
irof
10
3.9k
ASP.NETアプリケーションのモダナイズ インフラ編
tomokusaba
1
250
PT AI без купюр
v0lka
0
230
Gleamという選択肢
comamoca
6
720
Parallel::Pipesの紹介
skaji
2
910
UPDATEがシステムを複雑にする? イミュータブルデータモデルのすすめ
shimomura
1
550
GraphRAGの仕組みまるわかり
tosuri13
5
270
Practical Tips and Tricks for Working with Compose Multiplatform Previews (mDevCamp 2025)
stewemetal
0
120
Featured
See All Featured
Designing for Performance
lara
609
69k
The Pragmatic Product Professional
lauravandoore
35
6.7k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.3k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.3k
Building Adaptive Systems
keathley
43
2.6k
Adopting Sorbet at Scale
ufuk
77
9.4k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
A Tale of Four Properties
chriscoyier
159
23k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
16
920
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.8k
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