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
400
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
200
Don't fear the paren! 8 reasons you should give Clojure a try
gcapizzi
4
220
Other Decks in Programming
See All in Programming
Claude CodeとAgentCore Gatewayを繋ぐ際の認証認可 / Authentication and authorization when connecting Claude Code with AgentCore Gateway
har1101
2
420
楽しそうなつよつよエンジニアと目が死んでる僕/A brilliant engineer having a blast, and dead-eyed me.
3l4l5
2
280
Pythonの実行はどこまで賢くなったのか? CPythonとPyPyから見る最適化のしくみ
curekoshimizu
4
2.4k
go-spidermonkeyでAIエージェントのCode Modeを実装する
syumai
3
1.5k
AIエージェント時代のコードレビューを設計する
nogu66
5
2.1k
源内ハンズオン概要編
hideg
0
240
Hono + Inertia + React で LP を構築した話
oukayuka
2
200
AIの中の人になってみる
htkym
0
150
【QA Test Talk Vol.8】AI-DLC による Whole Team Approach の加速
pkshadeck
PRO
0
270
まずはプロンプトガイドを読もう、話はそれからだ
kiakiraki
1
250
「つくるAI」だけではバグは見つからない ~テストに必要な「見つけるAI」を分離させる戦略~
mfunaki
0
230
Gmail/Google DriveをトリガーにAIエージェントを動かそう! / Run AI agents with Gmail/Google Drive as triggers!
har1101
3
460
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.5k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
The SEO Collaboration Effect
kristinabergwall1
1
550
Documentation Writing (for coders)
carmenintech
77
5.5k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
360
Optimising Largest Contentful Paint
csswizardry
37
3.9k
Ethics towards AI in product and experience design
skipperchong
2
360
Game over? The fight for quality and originality in the time of robots
wayneb77
1
260
The Art of Programming - Codeland 2020
erikaheidi
57
14k
How to Talk to Developers About Accessibility
jct
2
530
Odyssey Design
rkendrick25
PRO
2
790
The World Runs on Bad Software
bkeepers
PRO
72
12k
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