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
0
52
Writing PHP extensions in Rust
Christian Rades
November 18, 2022
Tweet
Share
More Decks by Christian Rades
See All by Christian Rades
Your first PHP extension
crades
0
40
Go Reduce, reuse and recycle! PHP to GO!
crades
0
44
Static Code Analysis: Judging a Forest by Its Trees
crades
0
22
Other Decks in Technology
See All in Technology
テストを実行してSorbetのsigを書こう!
sansantech
PRO
1
130
プロジェクトマネジメントは不確実性との対話だ
hisashiwatanabe
0
100
MCPサーバーを活用したAWSコスト管理
arie0703
0
100
生成AIによるソフトウェア開発の収束地点 - Hack Fes 2025
vaaaaanquish
34
15k
AIエージェントを現場で使う / 2025.08.07 著者陣に聞く!現場で活用するためのAIエージェント実践入門(Findyランチセッション)
smiyawaki0820
7
1.2k
文字列の並び順 / String Collation
tmtms
1
100
生成AI活用のROI、どう測る? DMM.com 開発責任者から学ぶ「AI効果検証のノウハウ」 / ROI of AI
i35_267
3
110
Mackerel in さくらのクラウド
cubicdaiya
1
120
九州の人に知ってもらいたいGISスポット / gis spot in kyushu 2025
sakaik
0
180
薬屋のひとりごとにみるトラブルシューティング
tomokusaba
0
380
✨敗北解法コレクション✨〜Expertだった頃に足りなかった知識と技術〜
nanachi
1
760
Kiro と Q Dev で 同じゲームを作らせてみた
r3_yamauchi
PRO
1
110
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
139
34k
Scaling GitHub
holman
462
140k
Become a Pro
speakerdeck
PRO
29
5.5k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
36
2.5k
Unsuck your backbone
ammeep
671
58k
How STYLIGHT went responsive
nonsquared
100
5.7k
Testing 201, or: Great Expectations
jmmastey
45
7.6k
Into the Great Unknown - MozCon
thekraken
40
2k
[RailsConf 2023] Rails as a piece of cake
palkan
56
5.8k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
358
30k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
The Language of Interfaces
destraynor
158
25k
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/