Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
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
120
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
PHPをGoで動かす
2025/11/19 Go Connect #10 の登壇資料です。
chiroruxx
November 19, 2025
More Decks by chiroruxx
See All by chiroruxx
Contextとはなにか
chiroruxx
1
460
初心者エンジニアから中級者エンジニアになるためにオススメの1冊
chiroruxx
0
150
Laravelのパッケージ全部紹介する
chiroruxx
2
160
Gopher のための「自由な話し合い」ワークショップ
chiroruxx
0
56
Goを使ってTDDを体験しよう!
chiroruxx
1
1.4k
今ならできる!PhpStormプラグイン開発
chiroruxx
0
130
Go Connectへの想い
chiroruxx
0
250
eBPF with PHPをさわる
chiroruxx
0
210
sl完全に理解したつもり
chiroruxx
0
190
Other Decks in Technology
See All in Technology
GitHub Agentic Workflows を触ってみる
htkym
2
900
Execution in the Kingdom of Agents: Reflections on Abstraction and Complexity
bcantrill
0
510
Azure Copilot Resiliency Agentをいろいろ試してみる
tomokusaba
0
140
AI Made Us Faster at Solving the Wrong Problems
marceloancelmo
0
110
DORA_Metrics.pdf
wagnerfusca
1
140
手を動かして実感する、Kiro が変える開発体験
inariku
0
420
キャリアLT今日までそして明日から
kentapapa
1
140
Claude Designがめちゃくちゃ便利なので使ってほしい
diggymo
0
170
Oracle Cloud Infrastructure(OCI):Onboarding Session(はじめてのOCI/Oracle Supportご利⽤ガイド)
oracle4engineer
PRO
3
21k
AIエージェント時代のPlatform as a Product —— テックリードがPdMとして回す発見・導入・計測 / Platform as a Product in the AI Agent Era
toshi0607
1
550
形式手法を使って仕様をコーディングしよう
mikanichinose
0
160
Claude起点の仕様駆動開発
tanakaseiya
0
250
Featured
See All Featured
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
440
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
2k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
890
Paper Plane (Part 1)
katiecoart
PRO
2
11k
Navigating Weather and Climate Data
rabernat
0
540
Discover your Explorer Soul
emna__ayadi
2
1.3k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
340
Heart Work Chapter 1 - Part 1
lfama
PRO
10
36k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
Facilitating Awesome Meetings
lara
57
7.2k
Code Review Best Practice
trishagee
74
20k
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で動くと言っても過言ではないかもしれ ない!! ・・・過言か