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
400
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
200
Don't fear the paren! 8 reasons you should give Clojure a try
gcapizzi
4
210
Other Decks in Programming
See All in Programming
freeeにおけるEvalsの実践例の紹介
freee
PRO
0
110
torikago - Ruby::Boxで照らすモジュラモノリスの実行境界
se4weed
1
370
React本体のコードリーディング
high_g_engineer
1
140
わからない話を追いかけたら、プログラミング言語を作る側にいた
ydah
3
500
Android CLI
fornewid
0
220
freee が目指す データ マネジメント戦略 AI-Ready 時代を支える 攻めのガバナンスとは
freee
PRO
0
360
テーブルをDELETEした
yuzneri
0
140
言葉の格闘技のススメ~紙とペンと言葉から始める、キャリアの描き方~
progresscicada
2
150
「人を評価する AI」の設計と実装
ryoyanara
0
200
ソフトウェアエンジニアにとっての生成AI - 特性を知って使い倒す / generative ai for software enginner
kishida
3
770
関東Kaggler会_NVIDIA_Nemotron_コンペ_振り返り
rick_ds
0
570
生成AIで帳票OCRが「簡単に」作れる時代になった?
kon_shou
0
890
Featured
See All Featured
VelocityConf: Rendering Performance Case Studies
addyosmani
332
25k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
280
The SEO Collaboration Effect
kristinabergwall1
1
520
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
The Limits of Empathy - UXLibs8
cassininazir
1
600
A designer walks into a library…
pauljervisheath
211
24k
How to Think Like a Performance Engineer
csswizardry
28
2.7k
GitHub's CSS Performance
jonrohan
1033
470k
So, you think you're a good person
axbom
PRO
2
2.1k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
710
エンジニアに許された特別な時間の終わり
watany
108
250k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.4k
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