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
530
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
Tinkerbellから学ぶ、Podで DHCPをリッスンする手法
tomokon
0
140
Flutter On-device AI로 완성하는 오프라인 앱, 박제창 @DevFest INCHEON 2025
itsmedreamwalker
1
130
Socio-Technical Evolution: Growing an Architecture and Its Organization for Fast Flow
cer
PRO
0
380
ローカルLLMを⽤いてコード補完を⾏う VSCode拡張機能を作ってみた
nearme_tech
PRO
0
120
Graviton と Nitro と私
maroon1st
0
120
開発に寄りそう自動テストの実現
goyoki
2
1.3k
C-Shared Buildで突破するAI Agent バックテストの壁
po3rin
0
410
ELYZA_Findy AI Engineering Summit登壇資料_AIコーディング時代に「ちゃんと」やること_toB LLMプロダクト開発舞台裏_20251216
elyza
2
430
ローターアクトEクラブ アメリカンナイト:川端 柚菜 氏(Japan O.K. ローターアクトEクラブ 会長):2720 Japan O.K. ロータリーEクラブ2025年12月1日卓話
2720japanoke
0
740
SwiftUIで本格音ゲー実装してみた
hypebeans
0
460
ゲームの物理 剛体編
fadis
0
360
手が足りない!兼業データエンジニアに必要だったアーキテクチャと立ち回り
zinkosuke
0
790
Featured
See All Featured
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
0
390
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
0
26
Typedesign – Prime Four
hannesfritz
42
2.9k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
2
2.7k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
140
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
77
A designer walks into a library…
pauljervisheath
210
24k
It's Worth the Effort
3n
187
29k
Prompt Engineering for Job Search
mfonobong
0
120
Chasing Engaging Ingredients in Design
codingconduct
0
75
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
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