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
有効な使い方を正しく理解して実装する PHP8.3の最新機能の「ウラ側」 / Understa...
Search
shiro seike
PRO
July 02, 2024
Programming
1
250
有効な使い方を正しく理解して実装する PHP8.3の最新機能の「ウラ側」 / Understanding and Implementing Effective Usage Correctly The "Uraside" of PHP 8.3's Latest Features
Fusic Tech Live Vol.20 〜PHPer CONNECT〜
https://fusic.connpass.com/event/317123/
shiro seike
PRO
July 02, 2024
Tweet
Share
More Decks by shiro seike
See All by shiro seike
なぜ適用するか、移行して理解するClean Architecture 〜構造を超えて設計を継承する〜 / Why Apply, Migrate and Understand Clean Architecture - Inherit Design Beyond Structure
seike460
PRO
1
720
生成AIコーディングとの向き合い方、AIと共創するという考え方 / How to deal with generative AI coding and the concept of co-creating with AI
seike460
PRO
1
350
地方のPHPerもクラウドを使う理由 ~コストの最適化とチームに向き合う~ / Why even local PHPers use the cloud ~optimize costs and face the team
seike460
PRO
0
62
OpenTelemetryで始めるベンダーフリーなobservability / Vendor-free observability starting with OpenTelemetry
seike460
PRO
0
160
AIコーディングの本質は“コード“ではなく“構造“だった / The essence of AI coding is not “code” but "structure
seike460
PRO
2
1k
OpenTelemetryを活用したObservability入門 / Introduction to Observability with OpenTelemetry
seike460
PRO
1
640
Amazon Q Developer Proで効率化するAPI開発入門
seike460
PRO
0
300
Amazon Aurora DSQLパフォーマンスチェック / Amazon Aurora DSQL Performance Check
seike460
PRO
0
12
(再)ひとり技術広報からの脱却 / Re:Breaking away from one-man technical public relations
seike460
PRO
1
220
Other Decks in Programming
See All in Programming
PicoRuby on Rails
makicamel
2
120
deno-redisの紹介とJSRパッケージの運用について (toranoana.deno #21)
uki00a
0
170
Systèmes distribués, pour le meilleur et pour le pire - BreizhCamp 2025 - Conférence
slecache
0
120
来たるべき 8.0 に備えて React 19 新機能と React Router 固有機能の取捨選択とすり合わせを考える
oukayuka
2
880
ソフトウェア品質を数字で捉える技術。事業成長を支えるシステム品質の マネジメント
takuya542
0
400
なんとなくわかった気になるブロックテーマ入門/contents.nagoya 2025 6.28
chiilog
1
250
20250628_非エンジニアがバイブコーディングしてみた
ponponmikankan
0
600
PHPでWebSocketサーバーを実装しよう2025
kubotak
0
240
プロダクト志向ってなんなんだろうね
righttouch
PRO
0
170
Team operations that are not burdened by SRE
kazatohiei
1
290
Cursor AI Agentと伴走する アプリケーションの高速リプレイス
daisuketakeda
1
130
GitHub Copilot and GitHub Codespaces Hands-on
ymd65536
1
130
Featured
See All Featured
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.3k
4 Signs Your Business is Dying
shpigford
184
22k
Six Lessons from altMBA
skipperchong
28
3.9k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
24k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.5k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
107
19k
Why You Should Never Use an ORM
jnunemaker
PRO
58
9.4k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.4k
Large-scale JavaScript Application Architecture
addyosmani
512
110k
Building a Modern Day E-commerce SEO Strategy
aleyda
42
7.4k
Optimising Largest Contentful Paint
csswizardry
37
3.3k
Transcript
©Fusic Co., Ltd. 1 ༗ޮͳ͍ํΛਖ਼͘͠ཧղ࣮ͯ͢͠Δ PHP8.3ͷ࠷৽ػೳͷʮϥଆʯ 2024.07.02 @seike460 Fusic Tech
Live Vol.20 ʙPHPer CONNECTʙ
©Fusic Co., Ltd. 2 ਗ਼Ո ࢙ @seike460 AWS Community Builders
Serverless ݄ؒPHPΧϯϑΝϨϯε2024 - PHPΧϯϑΝϨϯεւಓ2024 ొஃ (LT) - PHPΧϯϑΝϨϯεؔ2024 ొஃ (LT) - PHPerKaigi2024 ొஃ (LT) - PHPΧϯϑΝϨϯεখాݪ2024 ొஃ - PHPΧϯϑΝϨϯε߳2024 ొஃ - PHPΧϯϑΝϨϯεԬ2024 ొஃ ࣗݾհ ͡Ίʹ גࣜձࣾFusic ϓϦϯγύϧΤϯδχΞ/ΤόϯδΣϦετ
©Fusic Co., Ltd. 3 CONTENTS ࣍ 1. PHP8.3ͷϦϦʔεʹ͍ͭͯৼΓฦΔͰ৮Εͨ͜ͱ 2. ·ͩ·ͩ͋ΔɺPHP8.3ͷΞοϓσʔτ
3. ֤ػೳͷઆ໌ͱར༻ྫ 4. ࠷৽ใΛऔಘ͢Δखஈ 5. ·ͱΊ
©Fusic Co., Ltd. 4 PHP8.3ͷϦϦʔεʹ͍ͭͯৼΓฦΔ Ͱ৮Εͨ͜ͱ 1
©Fusic Co., Ltd. 5 ઌिͷPHPΧϯϑΝϨϯεԬ2024Ͱͷൃද༰
©Fusic Co., Ltd. 6 PHP8.3ͷϦϦʔεʹ͍ͭͯৼΓฦΔ - PHP 8.3.0 - 202311݄23
- PHP 8.3.1 - 202312݄21 - PHP 8.3.2 - 20241݄18 - PHP 8.3.3 - 20242݄15 - PHP 8.3.4 - 20243݄14 - PHP 8.3.6 - 20244݄11 - PHP 8.3.7 - 20245݄9 - PHP 8.3.8 - 20246݄6 ɹɹɹɹɹɹɹɹɹɹɹɹ˞PHP8.3.5ReleasePage͔Βআࡁ
©Fusic Co., Ltd. 7 PHP8.3ͷαϙʔτظݶ - Active Support - 202511݄23
ࠓ͔Β520 - Security Support - 202611݄23 ࠓ͔Β885
©Fusic Co., Ltd. 8 ʮPHP8.3ͷϦϦʔεʹ͍ͭͯৼΓฦΔʯͰ৮Εͨͷ
©Fusic Co., Ltd. 9 ࣮·ͩ·ͩ͋Γ·͢
©Fusic Co., Ltd. 10 ࣮·ͩ·ͩ·ͩ͋Γ·͢
©Fusic Co., Ltd. 11 ࣮·ͩ·ͩ·ͩ·ͩ͋Γ·͢
©Fusic Co., Ltd. 12 ࣮·ͩ·ͩ·ͩ·ͩ͋Γ·͢
©Fusic Co., Ltd. 13 ࣮·ͩ·ͩ·ͩ·ͩ͋Γ·͢
©Fusic Co., Ltd. 14 ࣮·ͩ·ͩ·ͩ·ͩ͋Γ·͢
©Fusic Co., Ltd. 15 ࣮·ͩ·ͩ·ͩ·ͩ͋Γ·͢
©Fusic Co., Ltd. 16 ࣮·ͩ·ͩ·ͩ·ͩ͋Γ·͢
©Fusic Co., Ltd. 17 ·ͩ·ͩ͋ΔɺPHP8.3ͷΞοϓσʔτ 2
©Fusic Co., Ltd. 18 PHPΧϯϑΝϨϯεԬ2024Ͱ৮Εͨࣄ - ػೳͱͯ͠ͷՃ - Ϋϥεఆͷܕ͚ -
Ϋϥεఆͷจࣈྻࢦఆ - Attribute#[\Override]ͷՃ - ಡΈऔΓઐ༻ϓϩύςΟͷσΟʔϓΫϩʔϯ https://www.php.net/releases/8.3/ja.php
©Fusic Co., Ltd. 19 ຊͰ৮ΕΔࣄ - ແ໊Ϋϥεreadonly ͱͯ͠ϚʔΫͰ͖Δ - ϚδοΫϝιουͰ࡞ͬͨΫϩʔδϟ
໊લ͖ҾΛड͚ೖΕՄೳ - τϨΠτͷϝιουͷfinal ࢦఆ - static มͷॳظԽʹҙͷࣜར༻Մ https://www.php.net/manual/ja/migration83.new-features.php
©Fusic Co., Ltd. 20 ͓ؾʹೖΓͷίʔυγΣΞαʔϏε https://carbon.now.sh ͍ΖΜͳݴޠʹରԠͯͯ͠ ؾܰʹར༻Ͱ͖ΔͷͰΦεεϝ
©Fusic Co., Ltd. 21 ֤ػೳͷઆ໌ͱར༻ྫ 3
©Fusic Co., Ltd. 22 ͦͦແ໊Ϋϥεͱʁ ແ໊Ϋϥε ໊લΛ࣋ͨͳ͍Ϋϥε Ұ͚ͩ༻͢Δ߹ʹศར ར -
Ұ࣌༻͢ΔΦϒδΣΫτΛ͙͢ʹ ࡞Ͱ͖ίʔυͷ؆ܿ͞Λอͭ - ಗ໊ؔͱࣅ͍ͨํ͕Ͱ͖ɺ ؔϝιουͷҾͱͯ͢͠
©Fusic Co., Ltd. 23 ແ໊Ϋϥεʹͯreadonly͕ར༻Մೳʹ ྫ͑APIͷResponseͳͲɺ Ұઃఆͨ͠Βมߋͷඞཁ͕ͳ͍ͷ ࠨͷྫͷ߹ɺ ͢ͰʹHTTP OKͳΠϯελϯεͷ
εςʔλείʔυͷ্ॻ͖Λ͙ ͜͜ʹ readonly ͕ར༻Ͱ͖ͳ͍ ҧײΛղফͯ͠Δ෦͕େ͖ͦ͏
©Fusic Co., Ltd. 24 ͦͦmagic methodͱʁ PHPͰಛఆͷঢ়گԼͰ ࣗಈతʹݺͼग़͞ΕΔϝιου __construct() ɹΠϯελϯεԽ͞ΕΔͱ͖
__destruct() ɹΠϯελϯε͕ഁغ͞ΕΔͱ͖ __call() ɹଘࡏ͠ͳ͍ϝιου͕ ɹݺͼग़͞Εͨͱ͖
©Fusic Co., Ltd. 25 magic methodͰ࡞ΒΕͨClosureɿ໊લ͖Ҿ $seike->Magic(…)ʹͯClosure ͕ฦ͞ΕΔ ͦͷClosureʹʮShiroʯͱ͍͏ ໊લ͖ҾΛར༻ՄೳʹͳΔ
©Fusic Co., Ltd. 26 TraitͷΈ ΫϥεͰ࠶ར༻Մೳͳϝιουͷ ηοτΛఆٛ͢ΔͨΊͷΈ Use ExampleTrait; ʹͯ୯७ʹΠϯϙʔτ͢Δ͜ͱՄೳ
©Fusic Co., Ltd. 27 Trait Methodͷfinal ࢦఆ use ExampleTrait {
importantMethod as final; } ͷΑ͏ͳܗͰར༻Մೳʹ PHP8.2ͰΤϥʔʹͳΓ·͢
©Fusic Co., Ltd. 28 τϨΠτͷϝιουͷfinal ࢦఆ ࠓ·Ͱઈର্ॻ͖ͤͨ͘͞ͳ͔ͬͨ TraitϝιουOverrideग़དྷͯ͠·ͬͨ final ۟Λར༻͢Δ͜ͱͰ
OverrideΛېࢭͤ͞Δࣄ͕ग़དྷΔ
©Fusic Co., Ltd. 29 static มʹ͍ͭͯ static มʹ͍ͭͯ ؔϝιουͰએݴ ؔͷݺͼग़ؒ͠ͰͦͷΛอ࣋͢Δ
ॳظԽ͞ΕΔͱ࠶ݺͼग़͞Εͯ ͦͷΛอ࣋͢Δ
©Fusic Co., Ltd. 30 static มͷॳظԽʹҙͷࣜར༻Մ static มҙͷࣜΛຒΊࠐΈՄೳʹ Ұ͚ͩऔಘ͢Δ෦ʹࠩ͠ࠐΊΔ ྫ͑DBͷCounterͳͲʹར༻Մೳ
※ྫτϥϯβΫγϣϯ͕ແࢹ͞ΕΔ ਅࣅ͠ͳ͍Ͱ͍ͩ͘͞… Ұ͔͠ݺΕͳ͍ͷͰ Singletonͷ࣮ʹ͑Δ…ʁ
©Fusic Co., Ltd. 31 ࠷৽ใΛऔಘ͢Δखஈ 4
©Fusic Co., Ltd. 32 PHPϚχϡΞϧʹॾʑॻ͔Ε͍ͯΔ ࠷ॳհͨ͠PHPϚχϡΞϧʹ Ҡߦͱ͍͏ܗͰ͕ࠩઆ໌͞Ε͍ͯΔ
©Fusic Co., Ltd. 33 ͕ɺ࠷৽ͷใө͖͠Ε͍ͯͳ͍… magic methodͰ࡞ͬͨ Closure ʹؔͯ͠આ໌Έͯ૾͕͖ͮΒ͘ αϯϓϧίʔυͳͲͳͯ͘
ͲͷΑ͏ͳͷ͔গ͠໎ͬͨ Closure ͷઆ໌magic methods ·ͰϚχϡΞϧΛಡΜͰݟ·͕ͨ͠ ·ͩө͞Ε͍ͯ·ͤΜͰͨ͠ ݁ՌChatGPTsΈ͍ͨͳ෦ ඍົͳ݁Ռʹ
©Fusic Co., Ltd. 34 ۩ମʹؔͯ͠ӳจͰGitHubΛݕࡧ͢Δͷ͕ૣ͍ php / php-srcͷGitHubʹ ఆͷαϯϓϧίʔυͳͲ͍ͬͯͨ ߏจͳͲ͕ཧղग़དྷͨΓ͠·ͨ͠
ࠓճ࣮Ұ൪ݸਓతʹֶͼʹͳͬͨͷ͕ PHPϚχϡΞϧͱ php/php-srcΛ ྆ํಡΉ͜ͱͰ͍ΖΜͳใΛ ͑ΔΑ͏ʹͳΓ·ͨ͠
©Fusic Co., Ltd. 35 RFC͕PHPϚχϡΞϧʹग़ͯͨΓ͠·͢ https://wiki.php.net/rfc
©Fusic Co., Ltd. 36 ࠓिͷPHP Ұ෦·ͱΊͯ͘Ε͍ͯΔํ(@hanhan1978)͕͍ΔͷͰษڧʹͳΓ·͢
©Fusic Co., Ltd. 37 ·ͱΊ 5
©Fusic Co., Ltd. 38 ·ͱΊ PHP8.32026·Ͱར༻͠·͢ɻ͔ͬ͠Γ͖߹͍·͠ΐ͏ Point 01 PHP 8.3.0
Release Announcementʹ͍ͬͯͳ͍ػೳ͋Γ·͢ Point 02 ใΛूΊΔखஈΛཱ֬͢Δ͜ͱͰɺ͞Βʹֶͼ͕͕Γ·͢ɻࣗͨͪͷใͷ͍ํΛݟ͚ͭ·͠ΐ͏ʂ Point 03
©Fusic Co., Ltd. 39 Thank You We are Hiring! https://recruit.fusic.co.jp/
͝ਗ਼ௌ͍͖ͨͩ͋Γ͕ͱ͏͍͟͝·ͨ͠