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
350
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
150
Don't fear the paren! 8 reasons you should give Clojure a try
gcapizzi
4
180
Other Decks in Programming
See All in Programming
Blazing Fast UI Development with Compose Hot Reload (droidcon New York 2025)
zsmb
1
280
ペアプロ × 生成AI 現場での実践と課題について / generative-ai-in-pair-programming
codmoninc
1
3.6k
LINEヤフー データグループ紹介
lycorp_recruit_jp
0
1.8k
地方に住むエンジニアの残酷な現実とキャリア論
ichimichi
5
1.5k
“いい感じ“な定量評価を求めて - Four Keysとアウトカムの間の探求 -
nealle
1
2.4k
スタートアップの急成長を支えるプラットフォームエンジニアリングと組織戦略
sutochin26
0
330
PostgreSQLのRow Level SecurityをPHPのORMで扱う Eloquent vs Doctrine #phpcon #track2
77web
2
490
ニーリーにおけるプロダクトエンジニア
nealle
0
730
すべてのコンテキストを、 ユーザー価値に変える
applism118
2
1.1k
都市をデータで見るってこういうこと PLATEAU属性情報入門
nokonoko1203
1
590
20250704_教育事業におけるアジャイルなデータ基盤構築
hanon52_
5
410
PicoRuby on Rails
makicamel
2
120
Featured
See All Featured
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.4k
Producing Creativity
orderedlist
PRO
346
40k
How to Think Like a Performance Engineer
csswizardry
24
1.7k
YesSQL, Process and Tooling at Scale
rocio
173
14k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
Site-Speed That Sticks
csswizardry
10
680
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
130
19k
Music & Morning Musume
bryan
46
6.6k
Automating Front-end Workflow
addyosmani
1370
200k
Mobile First: as difficult as doing things right
swwweet
223
9.7k
Building a Modern Day E-commerce SEO Strategy
aleyda
42
7.4k
How to Ace a Technical Interview
jacobian
277
23k
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