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
70
0
Share
Writing PHP extensions in Rust
Christian Rades
November 18, 2022
More Decks by Christian Rades
See All by Christian Rades
Untangling graphs
crades
0
6
Your first PHP extension
crades
0
47
Go Reduce, reuse and recycle! PHP to GO!
crades
0
68
Static Code Analysis: Judging a Forest by Its Trees
crades
0
31
Other Decks in Technology
See All in Technology
Cloud Run のアップデート 触ってみる&紹介
gre212
0
300
【Gen-AX】20260530開催_JJUG CCC 2026 Spring
genax
0
410
[モダンアプリ勉強会]今更聞けないGit/GitHub入門
tsukuboshi
0
240
Claude code Orchestra
ozakiomumkj
3
940
Sony_KMP_Journey_KotlinConf2026
sony
2
210
コードレビューを制するチームがソフトウェアデリバリーのフローを制す / Beyond Code Review: Distributing Its Responsibilities Across the SDLC
mtx2s
3
1k
Oracle AI Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
4
2.8k
サイバーセキュリティ概論 / Introduction to Cybersecurity
ks91
PRO
0
140
DevOps Agentで始めるAWS運用 〜フロンティアエージェントが変える運用の現場〜
nyankotaro
1
140
正解のないAIプロダクトをどう導くか?dodaが挑む、ユーザーの『本音』を構造化する評価設計と検証のリアル
techtekt
PRO
0
170
Oracle Cloud Infrastructure IaaS 新機能アップデート 2026/3 - 2026/5
oracle4engineer
PRO
1
180
新規事業を牽引する技術選定 〜フルスタックTypeScript開発の実践事例〜
nullnull
2
300
Featured
See All Featured
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.4k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
220
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
160
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Context Engineering - Making Every Token Count
addyosmani
9
940
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.9k
Navigating Weather and Climate Data
rabernat
0
210
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
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/