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
5 Smashing Changes Your Extension Will Encounte...
Search
Rize MISUMI
November 24, 2015
Programming
0
2.9k
5 Smashing Changes Your Extension Will Encounter #phpblt
at PHP BLT (11/24)
Rize MISUMI
November 24, 2015
Tweet
Share
More Decks by Rize MISUMI
See All by Rize MISUMI
Effective Espresso #roppongi_aar
misumirize
0
2.3k
Build your APK beyond Docker #dockerlt
misumirize
2
2.9k
某イベントを支えるRuby
misumirize
0
960
Being Flux on Electron
misumirize
2
1.3k
Other Decks in Programming
See All in Programming
AI Coding Agent Enablement - エージェントを自走させよう
yukukotani
13
5.8k
Bedrock×MCPで社内ブログ執筆文化を育てたい!
har1101
6
900
エンジニア未経験が最短で戦力になるためのTips
gokana
0
260
趣味全開のAITuber開発
kokushin
0
190
RuboCop: Modularity and AST Insights
koic
0
100
Boost Your Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
1.2k
国漢文混用体からHolloまで
minhee
1
170
Go1.24 go vetとtestsアナライザ
kuro_kurorrr
2
840
Ruby's Line Breaks
yui_knk
2
480
5年間継続して開発した自作OSSの記録
bebeji_nappa
0
170
SwiftUI API Design Lessons
niw
1
260
データベースエンジニアの仕事を楽にする。PgAssistantの紹介
nnaka2992
9
4.5k
Featured
See All Featured
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
The Invisible Side of Design
smashingmag
299
50k
Optimising Largest Contentful Paint
csswizardry
36
3.2k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.2k
Gamification - CAS2011
davidbonilla
81
5.2k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.2k
Fireside Chat
paigeccino
37
3.4k
Into the Great Unknown - MozCon
thekraken
37
1.7k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
160
15k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
390
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.4k
Making the Leap to Tech Lead
cromwellryan
133
9.2k
Transcript
5 Smashing Changes Your Extension Will Encounter at PHP7 PHP
BLT #1 / @Misumi_Rize
var_dump($me); → Twitter @Misumi_Rize → GitHub @MisumiRize
Today I talk about...
phpize ./configure make make install
Upgrading extensions for PHP7
gophp7-ext Extensions Catalog https://github.com/gophp7/gophp7-ext/wiki/ extensions-catalog
None
None
How can I upgrade my extension?
Upgrading PHP extensions from PHP5 to NG https://wiki.php.net/phpng-upgrading
First of all: 75% of code will change
Create another branch
php-memcached "php7" branch https://github.com/php-memcached-dev/php- memcached/tree/php7
Note When installing extesions from GitHub, pickle is suitable https://github.com/FriendsOfPHP/pickle
./bin/pickle install https://github.com/php-memcached-dev/php-memcached.git#php7
5 Smashing Changes
1. zval
zval → zval** Z_*_PP() is obsolete → Change to use
zval* → PHP7 frequently uses zval directly → ALLOC_ZVAL, ALLOC_INIT_ZVAL, MAKE_STD_ZVAL has removed
2. char* at PHP
zend_string → Replacement of char* and int length → Many
of PHP's API using char* has replaced to zend_string
3. smart_str
smart_string → smart_str is only renamed to smart_string → Struct's
member is also renamed
4. HashTable
HashTable → Most API returns values, not SUCCESS, FAILURE →
char*, length based API (similar to PHP5) remains → But length is changed to exclude trailing zero
5. Objects
None
Conclusion → There's no best practice to upgrade extension now
→ Reading core extensions will help
Addition: interesting thing I've found #if (PHP_MAJOR_VERSION >= 6)