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
3
380
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
200
Other Decks in Programming
See All in Programming
今、アーキテクトとして 品質保証にどう関わるか
nealle
0
180
AIによる開発の民主化を支える コンテキスト管理のこれまでとこれから
mulyu
3
2.1k
CSC307 Lecture 13
javiergs
PRO
0
310
ぼくの開発環境2026
yuzneri
1
290
並行開発のためのコードレビュー
miyukiw
2
2k
grapheme_strrev関数が採択されました(あと雑感)
youkidearitai
PRO
1
160
Metaprogramming isn't real, it can't hurt you
okuramasafumi
0
130
Go1.26 go fixをプロダクトに適用して困ったこと
kurakura0916
0
310
izumin5210のプロポーザルのネタ探し #tskaigi_msup
izumin5210
1
470
Package Management Learnings from Homebrew
mikemcquaid
0
280
Go Conference mini in Sendai 2026 : Goに新機能を提案し実装されるまでのフロー徹底解説
yamatoya
0
420
AI駆動開発の本音 〜Claude Code並列開発で見えたエンジニアの新しい役割〜
hisuzuya
1
370
Featured
See All Featured
Test your architecture with Archunit
thirion
1
2.2k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.4k
The agentic SEO stack - context over prompts
schlessera
0
670
The Curse of the Amulet
leimatthew05
1
9.2k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
130
Paper Plane (Part 1)
katiecoart
PRO
0
4.9k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2.3k
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
A Tale of Four Properties
chriscoyier
162
24k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
WCS-LA-2024
lcolladotor
0
470
Marketing to machines
jonoalderson
1
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