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
pnl で簡易的に作る PHP ネイティブアプリケーション
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
memory
PRO
July 27, 2026
Programming
100
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
pnl で簡易的に作る PHP ネイティブアプリケーション
PHPerKaigi mini #3
memory
PRO
July 27, 2026
More Decks by memory
See All by memory
AI 時代のスタートアップエコシステ厶から考究する技術的負債との向き合い方
m3m0r7
PRO
3
3.4k
セグメントとターゲットを意識するプロポーザルの書き方 〜採択の鍵は、誰に刺すかを見極めるマーケティング戦略にある〜
m3m0r7
PRO
1
1.2k
PHP で mp3 プレイヤーを実装しよう
m3m0r7
PRO
0
610
PHP でエミュレータを自作して Ubuntu を動かそう
m3m0r7
PRO
2
360
AI 時代だからこそ学ぶべき PHP の基礎
m3m0r7
PRO
7
2.7k
JVM の仕組みを理解して PHP で実装してみよう
m3m0r7
PRO
1
700
コードゴルファー道
m3m0r7
PRO
0
680
ChatGPT とつくる PHP で OS 実装
m3m0r7
PRO
3
580
事業観点から見る技術的負債の返済
m3m0r7
PRO
4
1.3k
Other Decks in Programming
See All in Programming
APNsからLive Activityを開始する話
yumnumm
0
170
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
2
870
Starting & Sustaining Code-Based E2E Testing for Non-Coding QA Teams( #jasstniigata )
teyamagu
PRO
1
1k
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
220
見えないものを探る要求要件定義に必要な基本的思考 / invisible-requirement-thinking
minodriven
15
8.5k
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
270
Rでドレミ/Do-Re-Mi_with_R
florets1
0
130
Web Framework Benchmark Battle 2026, Any%
a_matsuda
2
2k
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
220
最近”作らせてる” ローカルAIアプリの話
akit37
0
470
Kotlinの15年とServer-Side Kotlin
n_takehata
1
150
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
750
Featured
See All Featured
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.7k
Large-scale JavaScript Application Architecture
addyosmani
516
110k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5.2k
Amusing Abliteration
ianozsvald
1
340
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
730
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
3.4k
Color Theory Basics | Prateek | Gurzu
gurzu
1
490
Ruling the World: When Life Gets Gamed
codingconduct
0
400
Rails Girls Zürich Keynote
gr2m
96
14k
Side Projects
sachag
456
43k
Building an army of robots
kneath
307
47k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.9k
Transcript
pnl で簡易的に作る PHP ネイティブアプリケーション PHPerKaigi mini #3 めもりー 1
めもりー m3m0r7 m3m0r7 m3m0r7 複数のスタートアップ企業,上場 企業でソフトウェアエンジニアや CTO として活動。 2
3
FFI を使うことで PHP でネイティブライブラリの呼び出せる 4
しかし,FFI をそれなりに使うには それなりの設計と,それなりの知識が必要 5
FFI を使うのに必要な設計と知識 ヘッダーファイルのパス解決 FFI で動くものと動かないもの マクロの処理 #include の解決 6
たとえば libc 7
libc のパス 実装 アーキテクチャ パス macOS Apple libSystem Apple Silicon
/usr/lib/libSystem.B.dylib Alpine musl x86_64 /lib/libc.musl-x86_64.so.1 musl arm64 /lib/libc.musl-aarch64.so.1 glibc x86_64 /lib/x86_64-linux-gnu/libc.so.6 glibc arm64 /lib/aarch64-linux-gnu/libc.so.6 Ubuntu Windows 8 UCRT C:\Windows\System32\ucrtbase.dll (または msvcrt.dll)
OS,アーキテクチャによって全然違う 9
ところで FFI のマニュアルを見てみよう… 10
11
12
パス解決は自分でやるしかない 13
ヘッダーに必要な型を 大量に定義する必要があるし… 14
15
ヘッダーファイルをそのまま流し込むこんでも エラーになる場合がある 16
PHP Fatal error: Uncaught FFI\ParserException: ';' expected, got '{' at
line 2 in /Volumes/develop/sandbox/b.php:13 Stack trace: #0 /Volumes/develop/sandbox/b.php(13): FFI::cdef('static inline i...') #1 {main} thrown in /Volumes/develop/sandbox/b.php on line 13 17
18
FFI は考慮すべきことが盛り沢山 19
そこで… 20
この課題をすべて解決するのが pnl 21
pnl: PHP Native Library https://github.com/m3m0r7/pnl 22
リリースからバイナリを落としてきて パスを通せばすぐ使えます 23
pnl install libsdl 24
ネイティブライブラリのインストールから PHP 用ランタイムの用意までたったこれだけ! 25
26
IDE Helper 等も出力されるので, メソッド・関数のサジェストももちろん AI フレンドリーな開発も可能 27
MessageBox もサクッと表示できたり 28
デスクトップに走り回るねこアプリを作ったり 29
ブロック崩しも作れます 30
なんなら四人麻雀も作れます 31
これ全部 PHP やで? 32
(pnl 自体は Rust で作られてますが…) 33
ご清聴ありがとうございました 34