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
Writing PHP extensions in Rust
Search
Christian Rades
November 18, 2022
Technology
63
0
Share
Writing PHP extensions in Rust
Christian Rades
November 18, 2022
More Decks by Christian Rades
See All by Christian Rades
Your first PHP extension
crades
0
43
Go Reduce, reuse and recycle! PHP to GO!
crades
0
65
Static Code Analysis: Judging a Forest by Its Trees
crades
0
25
Other Decks in Technology
See All in Technology
SSoT(Single Source of Truth)で「壊して再生」する設計
kawauso
2
410
【AWS】CloudTrail LakeとCloudWatch Logs Insightsの使い分け方針
tsurunosd
0
130
JSTQB Expert Levelシラバス「テストマネジメント」日本語版のご紹介
ymty
0
100
Cursor Subagentsはいいぞ
yug1224
2
130
スクラムを支える内部品質の話
iij_pr
0
160
サイボウズ 開発本部採用ピッチ / Cybozu Engineer Recruit
cybozuinsideout
PRO
10
77k
QA組織のAI戦略とAIテスト設計システムAITASの実践
sansantech
PRO
1
300
AWS DevOps Agent or Kiro の使いどころを考える_20260402
masakiokuda
0
140
ハーネスエンジニアリング×AI適応開発
aictokamiya
3
1.3k
制約を設計する - 非決定性との境界線 / Designing constraints
soudai
PRO
4
550
OPENLOGI Company Profile for engineer
hr01
1
62k
OpenClawでPM業務を自動化
knishioka
2
360
Featured
See All Featured
Faster Mobile Websites
deanohume
310
31k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
260
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
320
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
460
How to Think Like a Performance Engineer
csswizardry
28
2.5k
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Designing for humans not robots
tammielis
254
26k
We Are The Robots
honzajavorek
0
210
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
98
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.5k
Transcript
Twig as an Extension An Experiment powered by Rust
Hi everyone! My name Christian principal engineer at shopware @C_Rades
@
[email protected]
Titel hinzufügen
Why ? Reduce the reliance on opcache Maybe improve the
speed of rendering Have fun and learn about interpreters
How to ? The basics
Greeting
Hello World
Function calls
Calling a PHP function
Calling a function from rust
Method calls
Calling a php method
Calling a php method 2
Calling a method from rust
Calling a method from rust
Rust lifetimes are hard*
Escape hatches
Clone() • References need to ful fi l lifetimes •
So just use “owned” types • Comes in many fl avours • &str -> String • &Foo -> Foo
Zval::shallow_clone() • A little different for PHP values • It
copies the Zval without duplicating its content • &Zval -> Zval
A php obj as parameter
Thank you • The repo: https://github.com/Christian-Rades/Tape • The rust crate:
https://davidcole1340.github.io/ext-php-rs/introduction.html • Learning rust: https://doc.rust-lang.org/book/ • Learning Lifetimes: https://rust-unof fi cial.github.io/too-many-lists/