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
170
Don't fear the paren! 8 reasons you should give Clojure a try
gcapizzi
4
200
Other Decks in Programming
See All in Programming
The Monolith Strikes Back: Why AI Agents ❤️ Rails Monoliths
serradura
0
340
実用!Hono RPC2026
yodaka
2
250
Making the RBS Parser Faster
soutaro
0
500
Angular Signal Forms
debug_mode
0
120
AIを導入する前にやるべきこと
negima
2
150
「Linuxサーバー構築標準教科書」を読んでみた #ツナギメオフライン.7
akase244
0
1.4k
🦞OpenClaw works with AWS
licux
1
200
SREに優しいTerraform構成 modulesとstateの組み方
hiyanger
2
150
ついに来た!本格的なマルチクラウド時代の Google Cloud
maroon1st
0
220
VueエンジニアがReactを触って感じた_設計の違い
koukimiura
0
180
ハーネスエンジニアリングとは?
kinopeee
12
6k
Lightning-Fast Method Calls with Ruby 4.1 ZJIT / RubyKaigi 2026
k0kubun
3
1.1k
Featured
See All Featured
The Cost Of JavaScript in 2023
addyosmani
55
9.9k
So, you think you're a good person
axbom
PRO
2
2k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
65
55k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
100
Optimizing for Happiness
mojombo
378
71k
Tell your own story through comics
letsgokoyo
1
900
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
Rails Girls Zürich Keynote
gr2m
96
14k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
340
How to Ace a Technical Interview
jacobian
281
24k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.2k
Writing Fast Ruby
sferik
630
63k
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