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
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
41
Go Reduce, reuse and recycle! PHP to GO!
crades
0
50
Static Code Analysis: Judging a Forest by Its Trees
crades
0
23
Other Decks in Technology
See All in Technology
OpenCensusと歩んだ7年間
bgpat
0
330
ストレージエンジニアの仕事と、近年の計算機について / 第58回 情報科学若手の会
pfn
PRO
4
960
JAWS UG AI/ML #32 Amazon BedrockモデルのライフサイクルとEOL対応/How Amazon Bedrock Model Lifecycle Works
quiver
1
750
CLIPでマルチモーダル画像検索 →とても良い
wm3
2
780
激動の時代を爆速リチーミングで乗り越えろ
sansantech
PRO
1
250
GCASアップデート(202508-202510)
techniczna
0
260
Digitization部 紹介資料
sansan33
PRO
1
5.8k
IBC 2025 動画技術関連レポート / IBC 2025 Report
cyberagentdevelopers
PRO
2
250
Observability — Extending Into Incident Response
nari_ex
2
750
戦えるAIエージェントの作り方
iwiwi
21
10k
Mackerelにおけるインシデント対応とポストモーテム - 現場での工夫と学び
taxin
0
110
プロダクト開発と社内データ活用での、BI×AIの現在地 / Data_Findy
sansan_randd
1
790
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.5k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Site-Speed That Sticks
csswizardry
13
940
Six Lessons from altMBA
skipperchong
29
4k
It's Worth the Effort
3n
187
28k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
116
20k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.2k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
14k
Building Applications with DynamoDB
mza
96
6.7k
How STYLIGHT went responsive
nonsquared
100
5.9k
Why You Should Never Use an ORM
jnunemaker
PRO
60
9.6k
Documentation Writing (for coders)
carmenintech
76
5.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/