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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Christian Rades
November 18, 2022
Technology
78
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Writing PHP extensions in Rust
Christian Rades
November 18, 2022
More Decks by Christian Rades
See All by Christian Rades
Untangling graphs
crades
0
11
Your first PHP extension
crades
0
50
Go Reduce, reuse and recycle! PHP to GO!
crades
0
71
Static Code Analysis: Judging a Forest by Its Trees
crades
0
39
Other Decks in Technology
See All in Technology
Digital Credentials API × OpenID4VP ブラウザ完結型本人確認の実装知見(OAuth/OIDC Numa (Immersion) Workshop 2026)
oidfj
PRO
0
230
医療の現場を変革に挑戦した半年間の軌跡 - PythonとAIで現場を変える / From Code to Care
soudai
PRO
1
610
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
5k
ブラウザで変わるID連携(OAuth/OIDC Numa (Immersion) Workshop 2026)
oidfj
PRO
0
240
マイナンバーカード本人確認の実装比較(OAuth/OIDC Numa (Immersion) Workshop 2026) / 20260825 numa-12
oidfj
PRO
0
230
顧客の要望は2次情報である 〜アンテナを張るFDEの構造論〜
noriakioji
1
190
国家プロジェクトを支える「さくらONE」 大規模LLM開発におけるGPU障害を乗り越えるクラスター運用戦略
gpuunite_official
0
280
AI開発に用いられるHPC技術について
gpuunite_official
0
280
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
6
77k
What's new in Go 1.27?
ciarana
0
440
dbt in Microsoft Fabric
ryomaru0825
0
250
IHV like なユースケースへのOpenID Connect 関連仕様の適用事例
optim
0
240
Featured
See All Featured
Everyday Curiosity
cassininazir
0
290
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
510
The SEO Collaboration Effect
kristinabergwall1
1
530
How to Ace a Technical Interview
jacobian
281
24k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
630
Embracing the Ebb and Flow
colly
88
5.1k
Mobile First: as difficult as doing things right
swwweet
225
10k
The Language of Interfaces
destraynor
162
27k
Chasing Engaging Ingredients in Design
codingconduct
0
280
Balancing Empowerment & Direction
lara
6
1.2k
Building Applications with DynamoDB
mza
96
7.2k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
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/