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
3k
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.4k
Build your APK beyond Docker #dockerlt
misumirize
2
2.9k
某イベントを支えるRuby
misumirize
0
1k
Being Flux on Electron
misumirize
2
1.3k
Other Decks in Programming
See All in Programming
Go1.26 go fixをプロダクトに適用して困ったこと
kurakura0916
0
360
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
370
メタプログラミングで実現する「コードを仕様にする」仕組み/nikkei-tech-talk43
nikkei_engineer_recruiting
0
170
モジュラモノリスにおける境界をGoのinternalパッケージで守る
magavel
0
3.5k
Ruby and LLM Ecosystem 2nd
koic
1
480
エージェント開発初心者の僕がエージェントを作った話と今後やりたいこと
thasu0123
0
240
new(1.26) ← これすき / kamakura.go #8
utgwkk
0
2.2k
文字コードの話
qnighy
44
17k
猫の手も借りたい!ので AIエージェント猫を作って社内に放した話 Claude Code × Container Lambda の Slack Bot "DevNeko"
naramomi7
0
260
エラーログのマスキングの仕組みづくりに役立ったASTの話
kumoichi
0
170
オブザーバビリティ駆動開発って実際どうなの?
yohfee
3
810
ふつうのRubyist、ちいさなデバイス、大きな一年 / Ordinary Rubyists, Tiny Devices, Big Year
chobishiba
1
430
Featured
See All Featured
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
190
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
390
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8k
Faster Mobile Websites
deanohume
310
31k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
60
42k
Site-Speed That Sticks
csswizardry
13
1.1k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.7k
Side Projects
sachag
455
43k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Mind Mapping
helmedeiros
PRO
1
110
Raft: Consensus for Rubyists
vanstee
141
7.4k
Amusing Abliteration
ianozsvald
0
130
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)