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
360
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
180
Other Decks in Programming
See All in Programming
ALL CODE BASE ARE BELONG TO STUDY
uzulla
29
6.9k
マンガアプリViewerの大画面対応を考える
kk__777
0
450
CSC509 Lecture 11
javiergs
PRO
0
280
Node-REDのノードの開発・活用事例とコミュニティとの関わり(Node-RED Con Nagoya 2025)
404background
0
110
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
500
O Que É e Como Funciona o PHP-FPM?
marcelgsantos
0
250
MCPサーバー「モディフィウス」で変更容易性の向上をスケールする / modifius
minodriven
4
660
Dive into Triton Internals
appleparan
0
420
Amazon ECS Managed Instances が リリースされた!キャッチアップしよう!! / Let's catch up Amazon ECS Managed Instances
cocoeyes02
0
120
Module Proxyのマニアックな話 / Niche Topics in Module Proxy
kuro_kurorrr
0
1.3k
Migration to Signals, Resource API, and NgRx Signal Store
manfredsteyer
PRO
0
140
はじめてのDSPy - 言語モデルを『プロンプト』ではなく『プログラミング』するための仕組み
masahiro_nishimi
4
18k
Featured
See All Featured
Building an army of robots
kneath
306
46k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
31
2.7k
Writing Fast Ruby
sferik
630
62k
Scaling GitHub
holman
463
140k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.5k
Embracing the Ebb and Flow
colly
88
4.9k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
What's in a price? How to price your products and services
michaelherold
246
12k
Become a Pro
speakerdeck
PRO
29
5.6k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.7k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.1k
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