Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
Navigating Dependency Injection with Metro
l2hyunwoo
1
150
Rediscover the Console - SymfonyCon Amsterdam 2025
chalasr
2
180
TUIライブラリつくってみた / i-just-make-TUI-library
kazto
1
400
AtCoder Conference 2025「LLM時代のAHC」
imjk
2
540
Rubyで鍛える仕組み化プロヂュース力
muryoimpl
0
150
20251212 AI 時代的 Legacy Code 營救術 2025 WebConf
mouson
0
200
脳の「省エネモード」をデバッグする ~System 1(直感)と System 2(論理)の切り替え~
panda728
PRO
0
110
これだけで丸わかり!LangChain v1.0 アップデートまとめ
os1ma
6
1.9k
LLM Çağında Backend Olmak: 10 Milyon Prompt'u Milisaniyede Sorgulamak
selcukusta
0
130
「コードは上から下へ読むのが一番」と思った時に、思い出してほしい話
panda728
PRO
39
26k
Socio-Technical Evolution: Growing an Architecture and Its Organization for Fast Flow
cer
PRO
0
380
tparseでgo testの出力を見やすくする
utgwkk
2
260
Featured
See All Featured
The Limits of Empathy - UXLibs8
cassininazir
1
190
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
1k
Are puppies a ranking factor?
jonoalderson
0
2.3k
Fireside Chat
paigeccino
41
3.8k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.3k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandezseo
1
1.3k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
400
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
310
A better future with KSS
kneath
240
18k
Making Projects Easy
brettharned
120
6.5k
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