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
「ちゃんとした」パターンマッチとは?
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
hirunebot
August 06, 2026
9
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
「ちゃんとした」パターンマッチとは?
PHP の match 式では「ちゃんとした」パターンマッチができないそうなので、Rust の match 式と比較してみるLT資料です。
hirunebot
August 06, 2026
Featured
See All Featured
Everyday Curiosity
cassininazir
0
350
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
GitHub's CSS Performance
jonrohan
1033
470k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
500
Product Roadmaps are Hard
iamctodd
55
13k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.9k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1.1k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
500
Large-scale JavaScript Application Architecture
addyosmani
516
110k
エンジニアに許された特別な時間の終わり
watany
109
250k
Transcript
「ちゃんとした」パターンマッチとは? 昼寝bot 2026/8/5 CTOA若手エンジニアコミュニティ LT会 26年8月会
自己紹介 ・植松 歩 ・昼寝bot(@HiRuNe_bot_) ・株式会社カカクコム ・求人ボックスのWeb開発 ・JS、PHP ・最近 研修が終わった
PHP の match 式
パターンにマッチしてそう
None
「ちゃんとした」パターンマッチ ???
Rust ・関数型言語から強く影響されている ・パターンマッチあり ・強そう →Rustのパターンマッチを見てみよう
PHPのmatchと同じことができる
PHPのmatchではできないこと
PHPのmatchではできないこと
何が違うのか? ・Rust のパターンマッチでは、値と pattern を照合する ・値が pattern に合致するか判定 ・値の構造を分解 ・取り出した値を変数に束縛
・PHP の match が行うのは、基本的に値の一致判定(===) ・値の構造を分解できない ・分解した値を変数に束縛できない
まとめ ・同じ match でも、PHP と Rust ではかなり違う ・「ちゃんとした」パターンマッチ =パターンとの照合を通じて、単なる一致判定 だけでなく、値の分解や変数への束縛ができる
仕組み