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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
AI時代にあわせたQA組織戦略
masamiyajiri
6
2.8k
AWS Devops Agent ~ 自動調査とSlack統合をやってみた! ~
kubomasataka
2
250
【Oracle Cloud ウェビナー】[Oracle AI Database + Azure] AI-Ready データ戦略の最短ルート:Azure AIでビジネス データの価値を最大化
oracle4engineer
PRO
2
130
Werner Vogelsが14年間 問い続けてきたこと
yusukeshimizu
2
240
エンジニアとマネジメントの距離/Engineering and Management
ikuodanaka
3
670
ファシリテーション勉強中 その場に何が求められるかを考えるようになるまで / 20260123 Naoki Takahashi
shift_evolve
PRO
3
400
SREの仕事を自動化する際にやっておきたい5つのポイント
jacopen
6
1.1k
BiDiってなんだ?
tomorrowkey
2
500
Web Intelligence and Visual Media Analytics
weblyzard
PRO
1
6.8k
KubeCon + CloudNativeCon NA ‘25 Recap, Extensibility: Gateway API / NRI
ladicle
0
150
Git Training GitHub
yuhattor
1
270
ドメイン駆動セキュリティへの道しるべ
pandayumi
0
180
Featured
See All Featured
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
300
The Language of Interfaces
destraynor
162
26k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
180
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.2k
A better future with KSS
kneath
240
18k
Skip the Path - Find Your Career Trail
mkilby
0
49
GraphQLの誤解/rethinking-graphql
sonatard
74
11k
エンジニアに許された特別な時間の終わり
watany
106
230k
My Coaching Mixtape
mlcsv
0
41
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.1k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
110
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
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/