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
74
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
10
Your first PHP extension
crades
0
49
Go Reduce, reuse and recycle! PHP to GO!
crades
0
70
Static Code Analysis: Judging a Forest by Its Trees
crades
0
37
Other Decks in Technology
See All in Technology
認証認可だけじゃない! ID管理の構成要素と ライフサイクルを意識しよう
ritou
1
440
そのタスクオンスケですか?
poropinai1966
0
110
5分でわかる Amazon Connect_20260608
hwangbyeonghun
0
160
なぜ人は自分のプロジェクトを 「なんちゃってアジャイル」と 自嘲するのか
kozotaira
0
230
Oracle Exadata Database Service on Cloud@Customer X11M (ExaDB-C@C) サービス概要
oracle4engineer
PRO
2
8.3k
「軸足」は 固定しなくていい - 熱量と強みで描く、しなやかなキャリアの形
kakehashi
PRO
1
320
AIDLC_ヤフーショッピングの取り組み
lycorptech_jp
PRO
0
400
AI駆動開発におけるQAエンジニアの役割事例 〜AI駆動開発の現場から〜
kobayashiyorimitsu
0
220
AI時代における最適なQA組織の作り方
ymty
3
330
「勝手に広まる」人気 AI エージェントを爆速で作ろう!(AWS Summit Japan 2026講演資料)
minorun365
PRO
10
2.8k
LiDAR SLAMの実装とセンサ融合 ~Lie群からContinuous-Time LIOまで~
naokiakai
1
810
BPaaSで進むAIオペレーションの現在地 AI実装が効く領域とスケーラビリティの選定と実装
kentarofujii
0
250
Featured
See All Featured
Site-Speed That Sticks
csswizardry
13
1.2k
The Invisible Side of Design
smashingmag
301
52k
エンジニアに許された特別な時間の終わり
watany
107
250k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
400
Accessibility Awareness
sabderemane
1
150
Being A Developer After 40
akosma
91
590k
Bash Introduction
62gerente
615
220k
Building Adaptive Systems
keathley
44
3.1k
Faster Mobile Websites
deanohume
310
32k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.2k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Producing Creativity
orderedlist
PRO
348
40k
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/