Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
5 Smashing Changes Your Extension Will Encounter #phpblt
Rize MISUMI
November 24, 2015
Programming
0
2.5k
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
1.7k
Build your APK beyond Docker #dockerlt
misumirize
2
2.8k
某イベントを支えるRuby
misumirize
0
830
Being Flux on Electron
misumirize
2
1.1k
Other Decks in Programming
See All in Programming
段階的な技術的負債の解消方法.pdf
ko2ic
2
950
Agile Tech EXPO_2022/カケハシ
kakehashi
0
110
FullStack eXchange, July 2022
brucel
0
200
kintone × LINE Bot で餃子検定Botを作った話
naberina
0
340
SwiftUIで「意図」を伝える / swiftui_intention
uhooi
2
150
ZOZOTOWNにおけるDatadogの活用と、それを支える全社管理者の取り組み / 2022-07-27
tippy
1
3.5k
SAM × Dockerでサーバーレス開発が超捗った話
yu_yukk_y
1
430
Untangling Coroutine Testing (Droidcon Berlin 2022)
zsmb
2
490
SwiftUI+TCAに挑戦!NewsPicks iOSアプリのリアーキテクチャ/re-architecture-newspicks-ios-app-with-swiftui-and-tca
takehilo
0
420
RustのWebフレームワーク周りの概観
hayao
0
180
Amazon SageMakerでImagenを動かして猫画像生成してみた
hotoke_neko
0
120
VIMRC 2022
achimnol
0
140
Featured
See All Featured
Building Adaptive Systems
keathley
25
1.2k
Clear Off the Table
cherdarchuk
79
290k
Put a Button on it: Removing Barriers to Going Fast.
kastner
56
2.3k
Three Pipe Problems
jasonvnalue
89
8.7k
Web Components: a chance to create the future
zenorocha
303
40k
The Invisible Side of Design
smashingmag
290
48k
The Language of Interfaces
destraynor
148
21k
Building Applications with DynamoDB
mza
84
4.8k
GraphQLの誤解/rethinking-graphql
sonatard
31
6.8k
Pencils Down: Stop Designing & Start Developing
hursman
113
9.9k
Side Projects
sachag
450
37k
Bash Introduction
62gerente
598
210k
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)