Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
180
有効な使い方を正しく理解して実装する 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
AWS Lambdaから始まった Serverlessの「熱」とキャリアパス / It started with AWS Lambda Serverless “fever” and career path
seike460
PRO
1
430
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
1.1k
実践サーバーレスパフォーマンスチューニング ~その実力に迫る~ / Practical Serverless Performance Tuning ~A Close Look at its Power~
seike460
PRO
2
330
PHPを書く理由、PHPを書いていて良い理由 / Reasons to write PHP and why it is good to write PHP
seike460
PRO
5
570
AWS CDKを用いたセキュアなCI/CDパイプラインの構築 / Build a secure CI/CD pipeline using AWS CDK
seike460
PRO
3
730
いまあるチームにフィットさせる Serverless そして Platform Engineeringへの挑戦 / Serverless Fits the Team You Have and Platform Engineering
seike460
PRO
2
1.9k
いまあるチームにフィットさせる Serverless / Serverless fits in with the team you have now.
seike460
PRO
2
180
地方こそサーバーレス! チームにフィットさせるサーバーレス / Rural areas are serverless! Serverless to Fit Your Team
seike460
PRO
1
110
AWS X-Rayを利用したサーバーレスのパフォーマンス分析 / Serverless performance analysis using AWS X-Ray
seike460
PRO
2
170
Other Decks in Programming
See All in Programming
Figma Dev Modeで変わる!Flutterの開発体験
watanave
0
3.7k
Cognitoが大型アップデート!Managed Loginとパスワードレスログインを実際に使ってみた@しむそくRadio Special Day1
tmhirai
2
160
The Efficiency Paradox and How to Save Yourself and the World
hollycummins
1
100
新規学習のハードルを下げる方法とは?/ How to Make Learning Something New Easier?
nobuoooo
1
130
Criando Commits Incríveis no Git
marcelgsantos
1
120
eBPF Deep Dive: Architecture and Safety Mechanisms
takehaya
12
1.2k
5分ぐらいで分かる、トリミング機能の作り方
tsutsuitakumi
0
180
React への依存を最小にするフロントエンド設計
takonda
21
8.6k
React CompilerとFine Grained Reactivityと宣言的UIのこれから / The next chapter of declarative UI
ssssota
7
3.1k
14 Years of iOS: Lessons and Key Points
seyfoyun
0
400
Symfony Mapper Component
soyuka
2
330
MoQとか勉強会#2 発表資料
yuki_uchida
1
120
Featured
See All Featured
Designing Experiences People Love
moore
138
23k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
Happy Clients
brianwarren
98
6.7k
Writing Fast Ruby
sferik
627
61k
How to Ace a Technical Interview
jacobian
276
23k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
Building Applications with DynamoDB
mza
90
6.1k
Adopting Sorbet at Scale
ufuk
73
9.1k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
17k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
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/
͝ਗ਼ௌ͍͖ͨͩ͋Γ͕ͱ͏͍͟͝·ͨ͠