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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
chiroruxx
November 19, 2025
Technology
0
82
PHPをGoで動かす
2025/11/19 Go Connect #10 の登壇資料です。
chiroruxx
November 19, 2025
Tweet
Share
More Decks by chiroruxx
See All by chiroruxx
初心者エンジニアから中級者エンジニアになるためにオススメの1冊
chiroruxx
0
110
Laravelのパッケージ全部紹介する
chiroruxx
2
99
Gopher のための「自由な話し合い」ワークショップ
chiroruxx
0
29
Goを使ってTDDを体験しよう!
chiroruxx
1
910
今ならできる!PhpStormプラグイン開発
chiroruxx
0
82
Go Connectへの想い
chiroruxx
0
210
eBPF with PHPをさわる
chiroruxx
0
160
sl完全に理解したつもり
chiroruxx
0
150
命名をリントする
chiroruxx
1
990
Other Decks in Technology
See All in Technology
VLAモデル構築のための AIロボット向け模倣学習キット
kmatsuiugo
0
260
Postman v12 で変わる API開発ワークフロー (Postman v12 アップデート) / New API development workflow with Postman v12
yokawasa
0
140
めちゃくちゃ開発するQAエンジニアになって感じたメリットとこれからの課題感
ryuhei0000yamamoto
0
130
Yahoo!ショッピングのレコメンデーション・システムにおけるML実践の一例
lycorptech_jp
PRO
1
230
SLI/SLO 導入で 避けるべきこと3選
yagikota
0
110
AI時代の「本当の」ハイブリッドクラウド — エージェントが実現した、あの頃の夢
ebibibi
0
150
[JAWSDAYS2026]Who is responsible for IAM
mizukibbb
0
900
GCASアップデート(202601-202603)
techniczna
0
220
【Λ(らむだ)】最近のアプデ情報 / RPALT20260318
lambda
0
100
20260311 技術SWG活動報告(デジタルアイデンティティ人材育成推進WG Ph2 活動報告会)
oidfj
0
370
AIエージェント、 社内展開の前に知っておきたいこと
oracle4engineer
PRO
2
160
楽しく学ぼう!ネットワーク入門
shotashiratori
1
480
Featured
See All Featured
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
85
Side Projects
sachag
455
43k
Building Applications with DynamoDB
mza
96
7k
エンジニアに許された特別な時間の終わり
watany
106
240k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
310
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
180
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
770
GitHub's CSS Performance
jonrohan
1032
470k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
64
53k
It's Worth the Effort
3n
188
29k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.1k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
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で動くと言っても過言ではないかもしれ ない!! ・・・過言か