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
PHPをGoで動かす
Search
chiroruxx
November 19, 2025
Technology
0
65
PHPをGoで動かす
2025/11/19 Go Connect #10 の登壇資料です。
chiroruxx
November 19, 2025
Tweet
Share
More Decks by chiroruxx
See All by chiroruxx
Goを使ってTDDを体験しよう!
chiroruxx
1
650
今ならできる!PhpStormプラグイン開発
chiroruxx
0
59
Go Connectへの想い
chiroruxx
0
190
eBPF with PHPをさわる
chiroruxx
0
140
sl完全に理解したつもり
chiroruxx
0
130
命名をリントする
chiroruxx
1
880
良い命名かを調べるリンターを作った + α
chiroruxx
0
130
GoLandを布教する会
chiroruxx
0
47
PHPはいつから死んでいるかの調査
chiroruxx
3
690
Other Decks in Technology
See All in Technology
LINEギフト・LINEコマース領域の開発
lycorptech_jp
PRO
0
370
学術的根拠から読み解くNotebookLMの音声活用法
shukob
0
370
JJUG CCC 2025 Fall バッチ性能!!劇的ビフォーアフター
hayashiyuu1
1
410
AIと自動化がもたらす業務効率化の実例: 反社チェック等の調査・業務プロセス自動化
enpipi
0
780
クラスタ統合リアーキテクチャ全貌~1,000万ユーザーのウェルネスSaaSを再設計~
hacomono
PRO
0
140
How We Built a Secure Sandbox Platform for AI
flatt_security
1
110
DDD x Microservice Architecture : Findy Architecture Conf 2025
syobochim
12
4k
スタートアップの事業成長を支えるアーキテクチャとエンジニアリング
doragt
1
7.1k
未回答質問の回答一覧 / 開発をリードする品質保証 QAエンジニアと開発者の未来を考える-Findy Online Conference -
findy_eventslides
0
400
プロダクト負債と歩む持続可能なサービスを育てるための挑戦
sansantech
PRO
1
870
pmconf 2025 大阪「生成AI時代に未来を切り開くためのプロダクト戦略:圧倒的生産性を実現するためのプロダクトサイクロン」 / The Product Cyclone for Outstanding Productivity
yamamuteki
3
2.4k
2025年 面白の現在地 / Where Omoshiro Stands Today: 2025
acidlemon
0
540
Featured
See All Featured
How to Ace a Technical Interview
jacobian
280
24k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1k
Visualization
eitanlees
150
16k
How to Think Like a Performance Engineer
csswizardry
28
2.3k
Embracing the Ebb and Flow
colly
88
4.9k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
340
[RailsConf 2023] Rails as a piece of cake
palkan
57
6.1k
Being A Developer After 40
akosma
91
590k
Leading Effective Engineering Teams in the AI Era
addyosmani
8
1.1k
Docker and Python
trallard
46
3.7k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Transcript
GoでPHPを動かす 2025/11/19(水) GoConnect #10
⾃⼰紹介 ちひろ X: @chiroruxxxx 株式会社モリサワ
PHP on Go PHPの世界ではGoの上でPHPを動かす技術が話題になって るらしい お遊びではなく、プロダクションに投入され始めているとか…
FrankenPHP
なんかすごい 元々は個人プロジェクト だが、PHPコミュニティでメ ンテされるように Laravel で正式にサポート されたり
FrankenPHP の魅⼒ 色々あるが・・・ 個人的にはGoのコンテナフレンドリーさを享受できるところ
そろそろGoの話に・・・
frankenphp
サンプルコード func main() { code := ` $apple = 'red';
$banana = 'yellow'; $selected = 'banana'; echo "{$selected} is {$$selected}"; ` os.Exit( frankenphp.ExecutePHPCode(code) ) }
どのようにPHPを 動かしているのか
サンプルコード func main() { code := ` $apple = 'red';
$banana = 'yellow'; $selected = 'banana'; echo "{$selected} is {$$selected}"; ` os.Exit( frankenphp.ExecutePHPCode(code) ) }
ExecutePHP Code func ExecutePHPCode(phpCode string) int { // Ensure extensions
are registered before CLI execution registerExtensions() cCode := C.CString(phpCode) defer C.free(unsafe.Pointer(cCode)) return int( C.frankenphp_execute_script_cli( cCode, 0, nil, true ) ) }
frankenphp _execute _script_cli int frankenphp_execute_script_cli(char *script, int argc, char **argv,
bool eval) { // ... err = pthread_create(&thread, NULL, execute_script_cli, (void *)eval); if (err != 0) { return err; } err = pthread_join(thread, &exit_status); if (err != 0) { return err; } return (intptr_t)exit_status; }
execute _script_cli static void *execute_script_cli(void *arg) { // ... zend_first_try
{ if (eval) { zend_eval_string_ex(cli_script, NULL, "Command line code", 1); } else { // ... } } zend_end_try(); exit_status = (void *)(intptr_t)EG(exit_status); php_embed_shutdown(); return exit_status; }
zend_eval _string_ex
つまり 1. go 2. →cgo 3. →c 4. →php
まとめ Cで書かれた言語であればGoで動かせる? 言語側にembedする機能が必要ではある 多くの言語が実質Goで動くと言っても過言ではないかもしれ ない!! ・・・過言か