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
180
Don't fear the paren! 8 reasons you should give Clojure a try
gcapizzi
4
210
Other Decks in Programming
See All in Programming
RailsTokyo 2026#4: AI様があれば、 Hotwireの弱点は消えるか?
naofumi
2
340
ふにゃっとしない名前の付け方 〜哲学で茹で上げる、コシのあるソフトウェア設計〜
shimomura
0
120
Structured Concurrency, Scoped Values and Joiners in the JDK 25 26 27
josepaumard
1
150
ハーネスエンジニアリングにどう向き合うか 〜ルールファイルを超えて開発プロセスを設計する〜 / How to approach harness engineering
rkaga
28
23k
Agentic Elixir
whatyouhide
0
450
「なんか〇〇ライブラリで脆弱性あるみたいなんだけど。。。」から始める脆弱性対応 / First Steps in Vulnerability Response
mackey0225
2
130
SREに優しいTerraform構成 modulesとstateの組み方
hiyanger
2
180
PHPer、Cloudflare に引っ越す
suguruooki
2
220
Spec Driven Development | AI Summit Vilnius
danielsogl
PRO
1
160
AIを導入する前にやるべきこと
negima
2
360
AWSはOSSをどのように 考えているのか?
akihisaikeda
0
120
(Re)make Regexp in Ruby: Democratizing internals for the JIT
makenowjust
3
1.1k
Featured
See All Featured
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
370
Writing Fast Ruby
sferik
630
63k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.6k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.4k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
Site-Speed That Sticks
csswizardry
13
1.2k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
740
Code Review Best Practice
trishagee
74
20k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
390
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
700
So, you think you're a good person
axbom
PRO
2
2k
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