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
58
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
42
Go Reduce, reuse and recycle! PHP to GO!
crades
0
55
Static Code Analysis: Judging a Forest by Its Trees
crades
0
24
Other Decks in Technology
See All in Technology
配列に見る bash と zsh の違い
kazzpapa3
1
120
AzureでのIaC - Bicep? Terraform? それ早く言ってよ会議
torumakabe
1
450
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
10k
2人で作ったAIダッシュボードが、開発組織の次の一手を照らした話― Cursor × SpecKit × 可視化の実践 ― Qiita AI Summit
noalisaai
1
370
Bedrock PolicyでAmazon Bedrock Guardrails利用を強制してみた
yuu551
0
180
広告の効果検証を題材にした因果推論の精度検証について
zozotech
PRO
0
140
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
6
68k
~Everything as Codeを諦めない~ 後からCDK
mu7889yoon
3
300
Embedded SREの終わりを設計する 「なんとなく」から計画的な自立支援へ
sansantech
PRO
3
2.3k
Agile Leadership Summit Keynote 2026
m_seki
1
560
Data Hubグループ 紹介資料
sansan33
PRO
0
2.7k
学生・新卒・ジュニアから目指すSRE
hiroyaonoe
2
570
Featured
See All Featured
Designing Powerful Visuals for Engaging Learning
tmiket
0
230
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
3.9k
The SEO identity crisis: Don't let AI make you average
varn
0
67
We Have a Design System, Now What?
morganepeng
54
8k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
Design in an AI World
tapps
0
140
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
200
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
180
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
Building an army of robots
kneath
306
46k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.1k
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/