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
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
510
初心者エンジニアから中級者エンジニアになるためにオススメの1冊
chiroruxx
0
170
Laravelのパッケージ全部紹介する
chiroruxx
2
180
Gopher のための「自由な話し合い」ワークショップ
chiroruxx
0
59
Goを使ってTDDを体験しよう!
chiroruxx
1
1.4k
今ならできる!PhpStormプラグイン開発
chiroruxx
0
140
Go Connectへの想い
chiroruxx
0
250
eBPF with PHPをさわる
chiroruxx
0
220
sl完全に理解したつもり
chiroruxx
0
200
Other Decks in Technology
See All in Technology
Teaching Python with three kinds of AI
reuven
0
110
[FECONF-2026] 신대륙을 향한 카카오페이증권 프론트엔드 항해기 (이주승)
l1ghthouse
0
110
古い指輪から広がった JAVA コミュニティ とのつながり
yamad
0
150
Draft AIエージェントの トークン消費を最小化する 8つの原則
kinopeee
3
1.5k
局所最適は悪ではない。壊れているのは指標です。量と質を同時に見る先行指標の設計
recruitengineers
PRO
2
1.1k
AI秘書と毎日働くのはもう当たり前。開発以外の業務に足りない機能をどう埋める?
minorun365
PRO
0
440
Claude Codeから見る、エンジニアの世界の変容とその先
oikon48
2
510
プロダクトが成長すると、 プロダクトマネージャーの仕事はどう変わるのか - 「まず作る」から「小さく学び、確かめながら進む」へ
sansantech
PRO
0
260
【データ横丁主催】AI エージェント時代のTranslytical Data Platform
shisyu_gaku
0
280
構造で守らせる データ・法務・セキュリティ・開発チームとつくる AI時代のデータガバナンスとデータ基盤のリアル
legalontechnologies
PRO
0
110
AI駆動開発におけるハーネスエンジニアリングの勘所
tsukuboshi
1
670
LLM-as-a-Judgeは本当に信頼できるのか――評価器を評価する話
taka_aki
3
1.1k
Featured
See All Featured
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
59k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
490
Context Engineering - Making Every Token Count
addyosmani
9
1.2k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
ラッコキーワード サービス紹介資料
rakko
4
5.4M
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
580
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
540
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
310
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
290
The SEO Collaboration Effect
kristinabergwall1
1
600
The Limits of Empathy - UXLibs8
cassininazir
2
730
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
360
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で動くと言っても過言ではないかもしれ ない!! ・・・過言か