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
140
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
360
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
390
Plaing with Neo4j -[:USING]-> PHP
frne
0
470
PHP under the hood
frne
3
220
Other Decks in Programming
See All in Programming
使用 Meilisearch 建立新聞搜尋工具
johnroyer
0
220
FDEが実現するAI駆動経営の現在地
gonta
2
260
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
530
AI時代に設計が 最大の生産性レバーになる 意図駆動開発とデータを消さない設計|Don't Delete Your Data or Your Intent — Design as the Deepest Lever in the AI Era
tomohisa
1
680
プロポーザルを書いてもらう
pvcresin
0
230
Japan Community Day at Kubecon + CloudNativeCon Japan 2026: Learning Container Privilege Control by Building My Own Low-Level Container Runtime
ternbusty
1
130
PHP初心者セッション2026 〜生成AIでは見えない裏側を知る:今だからLAMPを通して仕組みを学ぶ〜
kashioka
0
840
「人を評価する AI」の設計と実装
ryoyanara
0
160
仕様駆動開発へのトライを機に チームに適合する手法を模索し続けている話
freee
PRO
0
420
Foundation Models frameworkで画像分析
ryodeveloper
1
570
作るコストが小さくなった時代 幸せに働くために改めて考えたいこと 〜エンジニアとして価値を出し続けるために注視している二分野〜
yuppeeng
0
190
改善しないと、タスクが回らない。 “てんこ盛りポジション” を引き継いだ情シスの、入社3ヶ月の業務改善録
krm963
0
250
Featured
See All Featured
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.4k
The Cost Of JavaScript in 2023
addyosmani
55
10k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
64
56k
The Cult of Friendly URLs
andyhume
79
7k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.8k
Testing 201, or: Great Expectations
jmmastey
46
8.2k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.5k
How to make the Groovebox
asonas
2
2.3k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
4.2k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
We Are The Robots
honzajavorek
0
290
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
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