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
Upgrading from PHP 5.3 to 5.5
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Glen Mailer
October 05, 2013
Programming
1
1.2k
Upgrading from PHP 5.3 to 5.5
A small talk on the experiences gained from migrating from PHP 5.3 to 5.5.
Glen Mailer
October 05, 2013
Tweet
Share
More Decks by Glen Mailer
See All by Glen Mailer
Are you afraid of dependencies?
glenjamin
0
140
How to React Appropriately
glenjamin
1
550
Bumping our Stack to PHP 5.5
glenjamin
0
260
Message Queues for Everyone
glenjamin
1
190
Messages queues don't need to be scary.
glenjamin
1
120
Other Decks in Programming
See All in Programming
RailsのValidatesをSwift Macrosで再現してみた
hokuron
0
130
OTP を自動で入力する裏技
megabitsenmzq
0
130
Everything Claude Code OSS詳細 — 5層構造の中身と導入方法
targe
0
150
[PHPerKaigi 2026]PHPerKaigi2025の企画CodeGolfが最高すぎて社内で内製して半年運営して得た内製と運営の知見
ikezoemakoto
0
280
「接続」—パフォーマンスチューニングの最後の一手 〜点と点を結ぶ、その一瞬のために〜
kentaroutakeda
3
1.9k
Redox OS でのネームスペース管理と chroot の実現
isanethen
0
430
我々はなぜ「層」を分けるのか〜「関心の分離」と「抽象化」で手に入れる変更に強いシンプルな設計〜 #phperkaigi / PHPerKaigi 2026
shogogg
2
390
new(1.26) ← これすき / kamakura.go #8
utgwkk
0
2.7k
LM Linkで(非力な!)ノートPCでローカルLLM
seosoft
0
160
PHP でエミュレータを自作して Ubuntu を動かそう
m3m0r7
PRO
2
140
へんな働き方
yusukebe
6
2.8k
ファインチューニングせずメインコンペを解く方法
pokutuna
0
170
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
46
8.1k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
820
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.5k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
120
WENDY [Excerpt]
tessaabrams
9
37k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
650
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
410
The World Runs on Bad Software
bkeepers
PRO
72
12k
The Cult of Friendly URLs
andyhume
79
6.8k
Six Lessons from altMBA
skipperchong
29
4.2k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
290
Transcript
None
Glen Mailer
The Codebase
First commit April 2010 60k commits since
9300 PHP files 690k lines of code According to git
and cloc
10 releases a week 35 active committers 10 concurrent streams
1 deployable
The Platform
8 Test Environments 1 Staging Environment 2 Live Environments
74 Live PHP boxes
1300 req/s peak 500k uniques/week
Why?
Using basically the same PHP version as the first commit
with security patches
PHP 5.3 is dead
Bug fixes Performance
New Features! short array syntax traits $this in closures yield
finally
but no smoking gun
Bug #64827 GC causes segfaults
The Plan
Upgrade a dev box Support 5.3 and 5.5 Pass all
tests Upgrade 1 Test env Upgrade CI Upgrade Test & Staging Incrementally Upgrade Live
Vagrant Chef Unit Tests Acceptance Tests
Hack hack hack...
3 days later
What changed?
APC becomes OPcache and APCu
Check for new function, fall back to old one if
(function_exists('opcache_reset')) { opcache_reset(); } else { apc_clear_cache(); }
“The PHP api will retain compatibility with APC, as will
common configuration options, providing a drop in replacement.” APCu
Not a drop in replacement
APCu 4.0.1 APCu 4.0.2
No more mysql_
It will not be missed
preg_replace /e becomes preg_replace_callback
(string) array() Now raises a warning Still returns “Array”
Type-checked function function inc($int) { if (!is_int($int)) { throw new
InvalidArgumentException( 'Expected int, got: ' . $int ); } return $int + 1; }
Unit test for type-checked function /** * @dataprovider provideIncInvalid */
function testIncRejectsInvalid($a) { try { inc($a); $this->fail('Expected exception'); } catch (InvalidArgumentException $ex) {} } function provideIncInvalid() { return array( null, true, "string", array() ); }
Simplest fix throw new InvalidArgumentException( 'Expected int, got: ' .
json_encode($int) );
$a = "string”; $a['index']; Now raises a warning
// protected $a; ++$this->a Now raises a warning
Progress
Upgrade a dev box Support 5.3 and 5.5 Pass all
tests Upgrade 1 Test env Upgrade CI Upgrade Test & Staging Incrementally Upgrade Live
Upgrade a dev box Support 5.3 and 5.5 Pass all
tests Upgrade 1 Test env Upgrade CI Upgrade Test & Staging Incrementally Upgrade Live
What now?
Finish Migrating Live
See if the hard to reproduce failures have stopped
Start using new features!
Keep up to date
You should upgrade too!
Fin.
Questions?
@glenathan https://joind.in/9473