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
PHP: The good, the bad and the ugly
Search
Giuseppe Capizzi
December 17, 2012
Programming
3
370
PHP: The good, the bad and the ugly
Giuseppe Capizzi
December 17, 2012
Tweet
Share
More Decks by Giuseppe Capizzi
See All by Giuseppe Capizzi
A (not so) gentle introduction to functional programming
gcapizzi
1
160
Don't fear the paren! 8 reasons you should give Clojure a try
gcapizzi
4
190
Other Decks in Programming
See All in Programming
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
470
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
140
2026年 エンジニアリング自己学習法
yumechi
0
140
CSC307 Lecture 10
javiergs
PRO
1
660
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
740
AIフル活用時代だからこそ学んでおきたい働き方の心得
shinoyu
0
140
Raku Raku Notion 20260128
hareyakayuruyaka
0
340
[KNOTS 2026登壇資料]AIで拡張‧交差する プロダクト開発のプロセス および携わるメンバーの役割
hisatake
0
290
なるべく楽してバックエンドに型をつけたい!(楽とは言ってない)
hibiki_cube
0
140
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
200
MUSUBIXとは
nahisaho
0
140
「ブロックテーマでは再現できない」は本当か?
inc2734
0
1k
Featured
See All Featured
Producing Creativity
orderedlist
PRO
348
40k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
GitHub's CSS Performance
jonrohan
1032
470k
Paper Plane (Part 1)
katiecoart
PRO
0
4.3k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
94
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
130
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
76
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
120
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.4k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
Practical Orchestrator
shlominoach
191
11k
Transcript
php the good, the bad & the ugly ?> <?
This is a rant!
the good
(...)
GoodThingsToSay::find("php"); // []
the bad
The PHP hammer
NOT predictable
What’s wrong and what’s not? $foo->nonExistent // Warning $foo::nonExistent //
Fatal error
Type hinting function foo(string $s) {} foo("hello world"); // PHP
Catchable fatal error: Argument 1 passed to foo() must be an instance of string, string given
empty() “ A variable is considered empty if it does
not exist or if its value equals FALSE” $var = ""; empty($var); // true, because "" == false
parse_str() parse_str("first=one&second=two"); echo $first; // one echo $second; // two
NOT consistent
htmlentities / html_entity_decode strpos / str_rot13 php_uname / phpversion base64_encode
/ urlencode, gettype / get_class underscores or not?
array_diff array_fill array_filter count shuffle sort array_* or not?
ascii2ebcdic bin2hex deg2rad strtolower strtotime “to” or “2”?
array_filter($input, $callback) array_map($callback, $input) strpos($haystack, $needle array_search($needle, $haystack) Argument order
NOT reliable
json_decode("null"); // null json_decode("invalid json"); // null json_decode
if (strpos("hello, world!", "hello")) { echo "found!"; } else {
echo "not found :("; } // not found :( array_search, strpos
the ugly
demo!
Not just a rant :)
the good
New stuff ★ Namespaces ★ Closures ★ Traits ★ Better
syntax
New ecosystem
New ecosystem
Conclusions ★ If you can, don’t use it! ★ If
you have to: • know your enemy :) • take advantage of the new goodness