Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Upgrading from PHP 5.3 to 5.5
Search
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
540
Bumping our Stack to PHP 5.5
glenjamin
0
250
Message Queues for Everyone
glenjamin
1
180
Messages queues don't need to be scary.
glenjamin
1
110
Other Decks in Programming
See All in Programming
AI Agent Tool のためのバックエンドアーキテクチャを考える #encraft
izumin5210
4
1.2k
Rubyで鍛える仕組み化プロヂュース力
muryoimpl
0
160
TerraformとStrands AgentsでAmazon Bedrock AgentCoreのSSO認証付きエージェントを量産しよう!
neruneruo
4
1.8k
新卒エンジニアのプルリクエスト with AI駆動
fukunaga2025
0
230
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
340
これならできる!個人開発のすゝめ
tinykitten
PRO
0
130
実はマルチモーダルだった。ブラウザの組み込みAI🧠でWebの未来を感じてみよう #jsfes #gemini
n0bisuke2
3
1.3k
The Art of Re-Architecture - Droidcon India 2025
siddroid
0
120
大規模Cloud Native環境におけるFalcoの運用
owlinux1000
0
190
Combinatorial Interview Problems with Backtracking Solutions - From Imperative Procedural Programming to Declarative Functional Programming - Part 2
philipschwarz
PRO
0
110
メルカリのリーダビリティチームが取り組む、AI時代のスケーラブルな品質文化
cloverrose
2
370
tsgolintはいかにしてtypescript-goの非公開APIを呼び出しているのか
syumai
7
2.3k
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1032
470k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
310
Digital Ethics as a Driver of Design Innovation
axbom
PRO
0
130
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
17
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
34
The SEO identity crisis: Don't let AI make you average
varn
0
36
The Curious Case for Waylosing
cassininazir
0
190
Accessibility Awareness
sabderemane
0
24
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
196
70k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
38
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
170
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