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
210
有効な使い方を正しく理解して実装する 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
Amazon Q Developer Proで効率化するAPI開発入門
seike460
PRO
0
120
(再)ひとり技術広報からの脱却 / Re:Breaking away from one-man technical public relations
seike460
PRO
1
140
PHPで作るWebSocketサーバー ~リアクティブなアプリケーションを知るために~ / WebSocket Server in PHP - To know reactive applications
seike460
PRO
2
900
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
260
AWS reInvent 2024サービスアップデートデモ / AWS reInvent 2024 Service Update Demo
seike460
PRO
0
44
AWS Lambdaから始まった Serverlessの「熱」とキャリアパス / It started with AWS Lambda Serverless “fever” and career path
seike460
PRO
1
620
とにかく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
390
PHPを書く理由、PHPを書いていて良い理由 / Reasons to write PHP and why it is good to write PHP
seike460
PRO
5
680
Other Decks in Programming
See All in Programming
PHP ステートレス VS ステートフル 状態管理と並行性 / php-stateless-stateful
ytake
0
110
AIプログラミング雑キャッチアップ
yuheinakasaka
9
1.5k
仕様変更に耐えるための"今の"DRY原則を考える
mkmk884
8
2.8k
Conform を推す - Advocating for Conform
mizoguchicoji
3
710
Software Architecture
hschwentner
6
2.1k
Grafana Loki によるサーバログのコスト削減
mot_techtalk
1
130
dbt Pythonモデルで実現するSnowflake活用術
trsnium
0
230
Djangoにおける複数ユーザー種別認証の設計アプローチ@DjangoCongress JP 2025
delhi09
PRO
4
410
sappoRo.R #12 初心者セッション
kosugitti
0
270
Boost Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
600
1年目の私に伝えたい!テストコードを怖がらなくなるためのヒント/Tips for not being afraid of test code
push_gawa
1
480
データベースのオペレーターであるCloudNativePGがStatefulSetを使わない理由に迫る
nnaka2992
0
230
Featured
See All Featured
Typedesign – Prime Four
hannesfritz
40
2.5k
VelocityConf: Rendering Performance Case Studies
addyosmani
328
24k
How to Think Like a Performance Engineer
csswizardry
22
1.4k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.1k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.4k
Embracing the Ebb and Flow
colly
84
4.6k
The Invisible Side of Design
smashingmag
299
50k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Building a Scalable Design System with Sketch
lauravandoore
461
33k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
10
1.3k
Visualization
eitanlees
146
15k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
21
2.5k
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/
͝ਗ਼ௌ͍͖ͨͩ͋Γ͕ͱ͏͍͟͝·ͨ͠