Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
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
390
Symfony High Availability in the Cloud
frne
0
640
Symfony 3 [german]
frne
0
430
Solr für Volltext-Suche oder gleich als Datenbank Engine
frne
0
410
Plaing with Neo4j -[:USING]-> PHP
frne
0
490
PHP under the hood
frne
3
230
Other Decks in Programming
See All in Programming
パスワード再設定メールのURLについて知っておこう
uyuki234
0
200
AI駆動開発4年目の現在地(『あなたはFDEになるべきか?』イベント資料)
kumaiu
0
110
Getting Started with Vibe Coding
miccheng
0
140
AI Augmentation Techniques with Liberty
ivargrimstad
0
240
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
1
1.9k
社内AIエージェント「Askワンバン」における コストチューニングの取り組み
t0yohei
0
120
React Native에 현대적인 빌드 도구 더하기: Rollipop 구현기
leegeunhyeok
0
180
クラウドゲーミングのパフォーマンス最適化に挑む / Cloud Gaming Performance Tuning
vivion
0
320
AI-Powered Domain-Driven Design
ziobrando
0
370
そのデザイントークン、Flutterでも同じ見た目になりますか?
nakamizu
0
230
Enforcing Your Architecture with Unit Tests in the AI Era (Swift Connection X)
steliosf
PRO
1
110
最近”作らせてる” ローカルAIアプリの話
akit37
0
530
Featured
See All Featured
Design in an AI World
tapps
1
380
The Cult of Friendly URLs
andyhume
79
7.1k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
560
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.3k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
600
Visualization
eitanlees
153
17k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
480
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.2k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
370
Unsuck your backbone
ammeep
672
58k
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