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
220
有効な使い方を正しく理解して実装する 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
OpenTelemetryを活用したObservability入門 / Introduction to Observability with OpenTelemetry
seike460
PRO
0
280
Amazon Q Developer Proで効率化するAPI開発入門
seike460
PRO
0
160
(再)ひとり技術広報からの脱却 / Re:Breaking away from one-man technical public relations
seike460
PRO
1
180
PHPで作るWebSocketサーバー ~リアクティブなアプリケーションを知るために~ / WebSocket Server in PHP - To know reactive applications
seike460
PRO
2
980
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
270
AWS reInvent 2024サービスアップデートデモ / AWS reInvent 2024 Service Update Demo
seike460
PRO
0
52
AWS Lambdaから始まった Serverlessの「熱」とキャリアパス / It started with AWS Lambda Serverless “fever” and career path
seike460
PRO
1
650
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
1.2k
実践サーバーレスパフォーマンスチューニング ~その実力に迫る~ / Practical Serverless Performance Tuning ~A Close Look at its Power~
seike460
PRO
2
410
Other Decks in Programming
See All in Programming
エンジニア未経験が最短で戦力になるためのTips
gokana
0
210
研究開発と実装OSSと プロダクトの好循環 / A virtuous cycle of research and development implementation OSS and products
linyows
1
190
보일러플레이트 코드가 진짜 나쁜 건가요?
gaeun5744
0
370
RCPと宣言型ポリシーについてのお話し
kokitamura
2
150
Return of the Full-Stack Developer
simas
PRO
1
310
マルチアカウント環境での、そこまでがんばらない RI/SP 運用設計
wa6sn
0
560
AI時代のプログラミング教育 / programming education in ai era
kishida
22
20k
아직도 SOLID 를 '글'로만 알고 계신가요?
sh1mj1
0
360
Go1.24で testing.B.Loopが爆誕
kuro_kurorrr
0
150
eBPF Updates (March 2025)
kentatada
0
130
WordPress Playground for Developers
iambherulal
0
120
GDG Super.init(version=6) - From Where to Wear : 모바일 개발자가 워치에서 발견한 인사이트
haeti2
0
560
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.3k
Rails Girls Zürich Keynote
gr2m
94
13k
KATA
mclloyd
29
14k
Testing 201, or: Great Expectations
jmmastey
42
7.4k
Producing Creativity
orderedlist
PRO
344
40k
A better future with KSS
kneath
238
17k
Designing for Performance
lara
606
69k
Building Your Own Lightsaber
phodgson
104
6.3k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
30k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.2k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
How to Ace a Technical Interview
jacobian
276
23k
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/
͝ਗ਼ௌ͍͖ͨͩ͋Γ͕ͱ͏͍͟͝·ͨ͠