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
memory
PRO
July 27, 2026
Programming
110
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.7k
セグメントとターゲットを意識するプロポーザルの書き方 〜採択の鍵は、誰に刺すかを見極めるマーケティング戦略にある〜
m3m0r7
PRO
1
1.3k
PHP で mp3 プレイヤーを実装しよう
m3m0r7
PRO
0
640
PHP でエミュレータを自作して Ubuntu を動かそう
m3m0r7
PRO
2
370
AI 時代だからこそ学ぶべき PHP の基礎
m3m0r7
PRO
7
2.7k
JVM の仕組みを理解して PHP で実装してみよう
m3m0r7
PRO
1
710
コードゴルファー道
m3m0r7
PRO
0
700
ChatGPT とつくる PHP で OS 実装
m3m0r7
PRO
3
580
事業観点から見る技術的負債の返済
m3m0r7
PRO
4
1.3k
Other Decks in Programming
See All in Programming
Goコンパイラを作ってGoをもっと理解する / Build a Go compiler to better understand Go
ikura_hamu
0
120
AIがコードを書いてくれる時代、我々は何を確かめるのか
yosuke_furukawa
PRO
13
5.8k
Coding with AI: How to trust the storyteller (AWS Community Day Adria, Ljubljana 2026)
slobodan
0
140
GraphQL の onError と Nullability のこれから
quramy
0
210
現場と育てるRailsモデリング 〜Spreadsheetから始めたモデル設計〜
siroemk
2
1.2k
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
1
2k
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
150
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
360
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
410
Kawaiicon: Kubernetes, it's no longer cool, but let's secure it anyway!
barnbarn
0
110
DroidKnights 2026 Android A2UI Jetpack Compose 기반의 안전한 AI UI 렌더링 - 박제창
itsmedreamwalker
1
200
プロジェクトコードをキレイキレイしよう!暗黙的な参照を読み解く静的解析
ostk0069
0
210
Featured
See All Featured
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
What the history of the web can teach us about the future of AI
inesmontani
PRO
3
790
Designing for Performance
lara
612
70k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.6k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3.3k
Faster Mobile Websites
deanohume
310
32k
A Soul's Torment
seathinner
8
3.9k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
48k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
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