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.2k
Build your APK beyond Docker #dockerlt
misumirize
2
2.8k
某イベントを支えるRuby
misumirize
0
950
Being Flux on Electron
misumirize
2
1.2k
Other Decks in Programming
See All in Programming
個人開発で使ってるやつを紹介する回
yohfee
1
640
tsconfig.jsonの最近の新機能 ファイルパス編
uhyo
6
1.3k
ECS向けのドリフト検知機構を実装してみた
tkikuc
0
260
2024-10-02 dev2next - Application Observability like you've never heard before
jonatan_ivanov
0
140
NANIMACHI
naokiito
0
930
Unlocking Python's Core Magic
leew
0
110
Quarto Clean Theme
nicetak
0
220
CSC509 Lecture 01
javiergs
PRO
1
200
Cloud Adoption Frameworkにみる組織とクラウド導入戦略(縮小版)
tomokusaba
1
150
AWS認定資格を受験するにあたり、気づいたこと・実践していたことのまとめ
satoshi256kbyte
1
120
Findy - エンジニア向け会社紹介 / Findy Letter for Engineers
findyinc
4
93k
pytest プラグインを開発して DRY に自動テストを書こう
inuatsu
2
240
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
229
18k
How To Stay Up To Date on Web Technology
chriscoyier
786
250k
Bootstrapping a Software Product
garrettdimon
PRO
304
110k
The Pragmatic Product Professional
lauravandoore
31
6.2k
BBQ
matthewcrist
84
9.2k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
92
16k
For a Future-Friendly Web
brad_frost
174
9.3k
Docker and Python
trallard
40
3k
Intergalactic Javascript Robots from Outer Space
tanoku
268
27k
Designing Experiences People Love
moore
138
23k
Raft: Consensus for Rubyists
vanstee
136
6.6k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
1
230
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)