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
360
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
Building AI with AI
inesmontani
PRO
1
460
Google Antigravity and Vibe Coding: Agentic Development Guide
mickey_kubo
2
120
WebRTC、 綺麗に見るか滑らかに見るか
sublimer
1
110
sbt 2
xuwei_k
0
150
【Streamlit x Snowflake】データ基盤からアプリ開発・AI活用まで、すべてをSnowflake内で実現
ayumu_yamaguchi
1
110
データファイルをAWSのDWHサービスに格納する / 20251115jawsug-tochigi
kasacchiful
2
100
スタートアップを支える技術戦略と組織づくり
pospome
8
14k
しっかり学ぶ java.lang.*
nagise
1
470
TypeScript 5.9 で使えるようになった import defer でパフォーマンス最適化を実現する
bicstone
1
850
大体よく分かるscala.collection.immutable.HashMap ~ Compressed Hash-Array Mapped Prefix-tree (CHAMP) ~
matsu_chara
1
200
dnx で実行できるコマンド、作ってみました
tomohisa
0
130
GeistFabrik and AI-augmented software development
adewale
PRO
0
230
Featured
See All Featured
A better future with KSS
kneath
240
18k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
253
22k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
370
How to Think Like a Performance Engineer
csswizardry
28
2.3k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.6k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.8k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
jQuery: Nuts, Bolts and Bling
dougneiner
65
8k
How to train your dragon (web standard)
notwaldorf
97
6.4k
KATA
mclloyd
PRO
32
15k
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