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
370
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
実はマルチモーダルだった。ブラウザの組み込みAI🧠でWebの未来を感じてみよう #jsfes #gemini
n0bisuke2
3
1.4k
JETLS.jl ─ A New Language Server for Julia
abap34
2
480
AgentCoreとHuman in the Loop
har1101
5
170
AIエージェントの設計で注意するべきポイント6選
har1101
6
3.2k
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
260
AtCoder Conference 2025
shindannin
0
950
例外処理とどう使い分ける?Result型を使ったエラー設計 #burikaigi
kajitack
16
5.5k
re:Invent 2025 トレンドからみる製品開発への AI Agent 活用
yoskoh
0
660
実は歴史的なアップデートだと思う AWS Interconnect - multicloud
maroon1st
0
320
ZJIT: The Ruby 4 JIT Compiler / Ruby Release 30th Anniversary Party
k0kubun
1
360
AI Agent Tool のためのバックエンドアーキテクチャを考える #encraft
izumin5210
6
1.7k
PostgreSQLで手軽にDuckDBを使う!DuckDB&pg_duckdb入門/osc25hi-duckdb
takahashiikki
0
250
Featured
See All Featured
Are puppies a ranking factor?
jonoalderson
0
2.6k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
The Curious Case for Waylosing
cassininazir
0
220
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
0
1.1k
ラッコキーワード サービス紹介資料
rakko
0
2M
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.3k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
150
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
67
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
34k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
40
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