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
NANIMACHI
naokiito
0
930
Kubernetes上でOracle_Databaseの運用を楽にするOraOperatorの紹介
nnaka2992
0
140
AWS CDKを用いたセキュアなCI/CDパイプラインの構築 / Build a secure CI/CD pipeline using AWS CDK
seike460
PRO
3
500
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
5
220
WEBアプリケーションにおけるAWS Lambdaを用いた大規模な非同期処理の実践
delhi09
PRO
7
3.7k
CSC509 Lecture 01
javiergs
PRO
1
200
Интеграционное тестирование: как приручить хаос
mariyasaygina
0
470
Cohesion in Modeling and Design
mploed
3
180
PHPを書く理由、PHPを書いていて良い理由 / Reasons to write PHP and why it is good to write PHP
seike460
PRO
5
270
クラウドサービスの 利用コストを削減する技術 - 円安の真南風を感じて -
pyama86
3
240
自分だけの世界を創るクリエイティブコーディング / Creative Coding: Creating Your Own World
chobishiba
1
120
全方位強化 Python 服務可觀測性:以 FastAPI 和 Grafana Stack 為例
blueswen
1
360
Featured
See All Featured
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
29
1.7k
Bootstrapping a Software Product
garrettdimon
PRO
304
110k
For a Future-Friendly Web
brad_frost
174
9.3k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
230
17k
Making the Leap to Tech Lead
cromwellryan
130
8.8k
A better future with KSS
kneath
235
17k
Into the Great Unknown - MozCon
thekraken
30
1.4k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
2
210
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3.4k
Web Components: a chance to create the future
zenorocha
310
42k
GitHub's CSS Performance
jonrohan
1030
450k
KATA
mclloyd
27
13k
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)