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
61
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
43
Go Reduce, reuse and recycle! PHP to GO!
crades
0
61
Static Code Analysis: Judging a Forest by Its Trees
crades
0
25
Other Decks in Technology
See All in Technology
情シスのための生成AI実践ガイド2026 / Generative AI Practical Guide for Business Technology 2026
glidenote
0
210
S3はフラットである –AWS公式SDKにも存在した、 署名付きURLにおけるパストラバーサル脆弱性– / JAWS DAYS 2026
flatt_security
0
1.7k
Oracle Database@Google Cloud:サービス概要のご紹介
oracle4engineer
PRO
5
1.2k
最強のAIエージェントを諦めたら品質が上がった話 / how quality improved after giving up on the strongest AI agent
kt2mikan
0
170
AWS DevOps Agent vs SRE俺 / AWS DevOps Agent vs me, the SRE
sms_tech
3
560
OCI Security サービス 概要
oracle4engineer
PRO
2
13k
Postman v12 で変わる API開発ワークフロー (Postman v12 アップデート) / New API development workflow with Postman v12
yokawasa
0
110
IBM Bobを使って、PostgreSQLのToDoアプリをDb2へ変換してみよう/202603_Dojo_Bob
mayumihirano
1
330
GitLab Duo Agent Platform + Local LLMサービングで幸せになりたい
jyoshise
0
290
2026-03-11 JAWS-UG 茨城 #12 改めてALBを便利に使う
masasuzu
2
370
PMとしての意思決定とAI活用状況について
lycorptech_jp
PRO
0
110
Dr. Werner Vogelsの14年のキーノートから紐解くエンジニアリング組織への処方箋@JAWS DAYS 2026
p0n
1
130
Featured
See All Featured
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.7k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
130
Agile that works and the tools we love
rasmusluckow
331
21k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
140
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
170
So, you think you're a good person
axbom
PRO
2
2k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Designing Experiences People Love
moore
143
24k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Technical Leadership for Architectural Decision Making
baasie
3
290
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/