Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Writing PHP extensions in Rust
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Christian Rades
November 18, 2022
Technology
90
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
Transcript
21 slides
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/
More Decks by Christian Rades
See All by Christian Rades
Untangling graphs
crades
0
21
Your first PHP extension
crades
0
58
Go Reduce, reuse and recycle! PHP to GO!
crades
0
76
Static Code Analysis: Judging a Forest by Its Trees
crades
0
47
Other Decks in Technology
See All in Technology
専門家に使ってもらうAIプロダクトをつくる - 病院の医事課向けDPCコーディング支援システムの設計と評価
hagino3000
4
1.1k
Libérez Firefox et Thunderbird avec nos astuces
hellosct1
0
190
OWASP AI Agentic Top10に準拠するクラウドネイティブなガードレールの実践(CNDW 2026)
keitah
1
450
SBOM 生成ツールで 2026 Minimum Elements はどこまで満たせるのか
gokken
0
160
リリースしたで終わらない。 観測できるフロントエンド開発
yamakenji24
4
820
FPGAでアクティブセンシングがやりたくてカメラモジュールを自作した話
ryuz88
0
100
フロントエンドのテストカバレッジは 100%強制がいい
bengo4com
7
2.9k
技術書典で本を売る流れ
yoshimura_datam
0
170
現場に渡し、構造で守る AI エージェントを活用したセルフサーブのデータ基盤の運用
legalontechnologies
PRO
0
120
AI-Ready なデータ基盤ってなに? & 新卒未経験が、いま考えていること
imuta
0
1.1k
その修正で本当に速くなったのか? k6とOpenTelemetryで確かめる性能改善 / Performance review with k6 and OpenTelemetry
ymotongpoo
3
450
みん強Lightning! データ基盤ひとりでできるかな
endonanana
0
220
Featured
See All Featured
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
480
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
610
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.8k
What's in a price? How to price your products and services
michaelherold
247
13k
Chasing Engaging Ingredients in Design
codingconduct
0
410
The Limits of Empathy - UXLibs8
cassininazir
2
800
My Coaching Mixtape
mlcsv
0
400
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
1.1k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
590
Everyday Curiosity
cassininazir
0
420
A Soul's Torment
seathinner
9
4k
Documentation Writing (for coders)
carmenintech
77
5.7k