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
390
3
Share
PHP: The good, the bad and the ugly
Giuseppe Capizzi
December 17, 2012
More Decks by Giuseppe Capizzi
See All by Giuseppe Capizzi
A (not so) gentle introduction to functional programming
gcapizzi
1
190
Don't fear the paren! 8 reasons you should give Clojure a try
gcapizzi
4
210
Other Decks in Programming
See All in Programming
開発体験を左右するライブラリの API 設計 - GraphQL スキーマ構築ライブラリから考える #tskaigi
izumin5210
2
1.6k
フロントエンドとバックエンドで「1文字」を揃えよう
youkidearitai
PRO
0
180
「AIで開発し、AIを届ける」をEvalでつなぐ 〜AIネイティブに始めるプロダクト開発の実践〜 / Connecting "Develop with AI, deliver AI" with Eval
rkaga
4
2.1k
Migrations : C'est une question d'hygiène !
vinceamstoutz
0
3.2k
tsserverとは何だったのか、これからどうなるのか
nowaki28
1
440
3Dシーンの圧縮
fadis
1
590
Technical Debt: Understanding it Rightly, Engaging it Rightly #LaravelLiveJP
shogogg
0
190
今さら聞けないCancellationToken
htkym
0
220
Composerを使ったサプライチェーン攻撃の様子を眺めてみる #phpstudy
o0h
PRO
2
220
AIとASP.NET Coreで雑Webアプリを作った話
mayuki
0
260
RTSPクライアントを自作してみた話
simotin13
0
440
IBM Bobを活用したレガシーアプリの最新化
oniak3ibm
PRO
1
170
Featured
See All Featured
Building Applications with DynamoDB
mza
96
7.1k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.3k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
520
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
210
Side Projects
sachag
455
43k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
550
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
130
The Curious Case for Waylosing
cassininazir
1
370
Practical Orchestrator
shlominoach
191
11k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.5k
A designer walks into a library…
pauljervisheath
211
24k
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