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
今日から始めるAmazon Bedrock AgentCore
har1101
4
400
セキュリティについて学ぶ会 / 2026 01 25 Takamatsu WordPress Meetup
rocketmartue
1
300
10Xにおける品質保証活動の全体像と改善 #no_more_wait_for_test
nihonbuson
PRO
2
230
Codex 5.3 と Opus 4.6 にコーポレートサイトを作らせてみた / Codex 5.3 vs Opus 4.6
ama_ch
0
120
Cosmos World Foundation Model Platform for Physical AI
takmin
0
770
Context Engineeringの取り組み
nutslove
0
320
~Everything as Codeを諦めない~ 後からCDK
mu7889yoon
3
310
Introduction to Bill One Development Engineer
sansan33
PRO
0
360
OCI Database Management サービス詳細
oracle4engineer
PRO
1
7.4k
こんなところでも(地味に)活躍するImage Modeさんを知ってるかい?- Image Mode for OpenShift -
tsukaman
0
120
学生・新卒・ジュニアから目指すSRE
hiroyaonoe
2
580
Claude_CodeでSEOを最適化する_AI_Ops_Community_Vol.2__マーケティングx_AIはここまで進化した.pdf
riku_423
2
530
Featured
See All Featured
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
450
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
1
99
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
0
2.3k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Everyday Curiosity
cassininazir
0
130
The Curse of the Amulet
leimatthew05
1
8.4k
SEO for Brand Visibility & Recognition
aleyda
0
4.2k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
130
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
320
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
92
A designer walks into a library…
pauljervisheath
210
24k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
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/