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 Encounter #phpblt
Search
Rize MISUMI
November 24, 2015
Programming
0
2.8k
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.1k
Build your APK beyond Docker #dockerlt
misumirize
2
2.8k
某イベントを支えるRuby
misumirize
0
930
Being Flux on Electron
misumirize
2
1.2k
Other Decks in Programming
See All in Programming
PHP 8.3で追加されたjson_validate()を徹底的に深掘りしてみよう
mashirou1234
1
720
自作ソフト(VMagicMirror)がVRMA対応してる話+実装のTips
bakudreameater
0
110
15分間でふんわり理解するDocker @ Matsuriba MAX
ukwhatn
PRO
1
330
LPIXEL×CADDi_kaerururu
kaerururu
3
300
Learning PHP and Static Analysis with PHP Parser
inouehi
1
250
PHPerKaigi 2024〜10年以上動いているレガシーなバッチシステムを Kubernetes(Amazon EKS) に移行する取り組み〜
tshinowpub
1
220
デザインシステムで Tailwind CSSとCSS in JSに分散投資をしたら良かった話
fsubal
14
2.9k
Ruby製社内ツールのGo移行
bgpat
2
260
ISUCONってなんだか難しそう……!!でも、初めてのISUCONにPHPで挑戦してきました!
kotomin_m
1
300
Dockerで始めるAWS Lambda開発
stutkhd0709
13
2.5k
まっちすいっち戦争 / match vs switch
takuyakatsusa
2
660
Why 1 + 1 = 2 in Swift?
1plus4
1
240
Featured
See All Featured
Thoughts on Productivity
jonyablonski
57
3.8k
Being A Developer After 40
akosma
56
580k
From Idea to $5000 a Month in 5 Months
shpigford
376
45k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
67
38k
JazzCon 2018 Closing Keynote - Leadership for the Reluctant Leader
reverentgeek
178
11k
Keith and Marios Guide to Fast Websites
keithpitt
407
22k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
11
1.4k
Design by the Numbers
sachag
274
18k
5 minutes of I Can Smell Your CMS
philhawksworth
199
19k
Building Adaptive Systems
keathley
29
1.8k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
19
1.9k
BBQ
matthewcrist
78
8.7k
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)