Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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
55
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
53
Static Code Analysis: Judging a Forest by Its Trees
crades
0
24
Other Decks in Technology
See All in Technology
regrowth_tokyo_2025_securityagent
hiashisan
0
170
Microsoft Agent 365 を 30 分でなんとなく理解する
skmkzyk
1
1k
re:Invent 2025 ふりかえり 生成AI版
takaakikakei
1
180
大企業でもできる!ボトムアップで拡大させるプラットフォームの作り方
findy_eventslides
1
570
ブロックテーマとこれからの WordPress サイト制作 / Toyama WordPress Meetup Vol.81
torounit
0
510
Snowflakeでデータ基盤を もう一度作り直すなら / rebuilding-data-platform-with-snowflake
pei0804
2
770
GitLab Duo Agent Platformで実現する“AI駆動・継続的サービス開発”と最新情報のアップデート
jeffi7
0
210
EM歴1年10ヶ月のぼくがぶち当たった苦悩とこれからへ向けて
maaaato
0
270
AI時代におけるアジャイル開発について
polyscape_inc
0
130
Kiro Autonomous AgentとKiro Powers の紹介 / kiro-autonomous-agent-and-powers
tomoki10
0
320
eBPFとwaruiBPF
sat
PRO
4
2.5k
計算機科学をRubyと歩む 〜DFA型正規表現エンジンをつくる~
ydah
3
200
Featured
See All Featured
Java REST API Framework Comparison - PWX 2021
mraible
34
9k
[SF Ruby Conf 2025] Rails X
palkan
0
490
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.2k
Producing Creativity
orderedlist
PRO
348
40k
Build The Right Thing And Hit Your Dates
maggiecrowley
38
3k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Rebuilding a faster, lazier Slack
samanthasiow
84
9.3k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.3k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
253
22k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.1k
Facilitating Awesome Meetings
lara
57
6.7k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
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/