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
57
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
54
Static Code Analysis: Judging a Forest by Its Trees
crades
0
24
Other Decks in Technology
See All in Technology
AWS Lambda durable functions を使って AWS Lambda の15分の壁を超えてみよう
matsuzawatakeshi
0
120
Redshift認可、アップデートでどう変わった?
handy
1
120
Agent Skillsがハーネスの垣根を超える日
gotalab555
7
5k
「アウトプット脳からユーザー価値脳へ」がそんなに簡単にできたら苦労しない #RSGT2026
aki_iinuma
5
1.2k
なぜ あなたはそんなに re:Invent に行くのか?
miu_crescent
PRO
0
240
AWSインフルエンサーへの道 / load of AWS Influencer
whisaiyo
0
240
2025年の医用画像AI/AI×medical_imaging_in_2025_generated_by_AI
tdys13
0
260
Knowledge Work の AI Backend
kworkdev
PRO
0
340
Agentic AIが変革するAWSの開発・運用・セキュリティ ~Frontier Agentsを試してみた~ / Agentic AI transforms AWS development, operations, and security I tried Frontier Agents
yuj1osm
0
170
「リリースファースト」の実感を届けるには 〜停滞するチームに変化を起こすアプローチ〜 #RSGT2026
kintotechdev
0
260
[2025-12-12]あの日僕が見た胡蝶の夢 〜人の夢は終わらねェ AIによるパフォーマンスチューニングのすゝめ〜
tosite
0
230
自己管理型チームと個人のセルフマネジメント 〜モチベーション編〜
kakehashi
PRO
2
350
Featured
See All Featured
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
120
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
80
Making the Leap to Tech Lead
cromwellryan
135
9.7k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
0
1.1k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
280
Being A Developer After 40
akosma
91
590k
GitHub's CSS Performance
jonrohan
1032
470k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
89
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
0
3.4k
For a Future-Friendly Web
brad_frost
180
10k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.1k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
37
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/