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の最新機能 / Proper underst...
Search
shiro seike
PRO
June 22, 2024
Programming
2
380
有効な使い方を正しく理解して実装する PHP8.3の最新機能 / Proper understanding and implementation of effective usage Latest features in PHP 8.3
PHPカンファレンス福岡2024
https://phpcon.fukuoka.jp/2024/
shiro seike
PRO
June 22, 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
250
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
860
実践サーバーレスパフォーマンスチューニング ~その実力に迫る~ / Practical Serverless Performance Tuning ~A Close Look at its Power~
seike460
PRO
2
320
PHPを書く理由、PHPを書いていて良い理由 / Reasons to write PHP and why it is good to write PHP
seike460
PRO
5
560
AWS CDKを用いたセキュアなCI/CDパイプラインの構築 / Build a secure CI/CD pipeline using AWS CDK
seike460
PRO
3
700
いまあるチームにフィットさせる 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
170
地方こそサーバーレス! チームにフィットさせるサーバーレス / 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
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
9
3.3k
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
1k
Make Impossible States Impossibleを 意識してReactのPropsを設計しよう
ikumatadokoro
0
170
OSSで起業してもうすぐ10年 / Open Source Conference 2024 Shimane
furukawayasuto
0
100
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
1.8k
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
2
350
Jakarta EE meets AI
ivargrimstad
0
580
どうして僕の作ったクラスが手続き型と言われなきゃいけないんですか
akikogoto
1
120
CSC509 Lecture 12
javiergs
PRO
0
160
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
170
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
6
1.1k
AWS IaCの注目アップデート 2024年10月版
konokenj
3
3.3k
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
297
20k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
120
Practical Orchestrator
shlominoach
186
10k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Code Reviewing Like a Champion
maltzj
520
39k
Transcript
©Fusic Co., Ltd. 1 ༗ޮͳ͍ํΛਖ਼͘͠ཧղ࣮ͯ͢͠Δ PHP8.3ͷ࠷৽ػೳ 2024.06.22 @seike460 PHPΧϯϑΝϨϯεԬ2024
©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 ొஃ Nowʂ ࣗݾհ ͡Ίʹ גࣜձࣾFusic ϓϦϯγύϧΤϯδχΞ/ΤόϯδΣϦετ
©Fusic Co., Ltd. 3 CONTENTS ࣍ 1. PHP8.3ͷϦϦʔεʹ͍ͭͯৼΓฦΔ 2. PHP8.3ͷ৽ػೳϦετΞοϓ
3. ֤ػೳͷઆ໌ͱར༻ྫ 4. PHP8.4Λ͘ 5. ·ͱΊ
©Fusic Co., Ltd. 4 PHP8.3ͷϦϦʔεʹ͍ͭͯৼΓฦΔ 1
©Fusic Co., Ltd. 5 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ɹɹɹɹ ※PHP8.3.5ReleasePage͔Βআࡁ - 20244݄11 - PHP 8.3.7 - 20245݄9
©Fusic Co., Ltd. 6 PHP8.3.5…? PHP8.3.5͕ͳ͔ͬͨΜͰ͢ΑͶ ͬͯΛ@tadsanʹͨ͠Β ͋ͬͱ͍͏ؒʹௐͯ͘Ε·ͨ͠ʂ ▪ຊޠ༁ PHP
։ൃνʔϜPHP 8.3.6 ͷଈ࣌ϦϦʔεΛΞφϯε͠·͢ ͜ΕCVE-2024-1874 ʹ ରॲͨ͠ηΩϡϦςΟϦϦʔεͰ͢
©Fusic Co., Ltd. 7 PHP8.3ͷαϙʔτظݶ - Active Support - 202511݄23
ࠓ͔Β520 - Security Support - 202611݄23 ࠓ͔Β885
©Fusic Co., Ltd. 8 ͳͥ৽͍͠ػೳΛཧղ͢Δͷ͔ ਖ਼͘͠ػೳΛཧղ࣮ͯ͢͠ΔͱҎԼͷΑ͏ͳԸܙ͕ - ҆શੑͷ্ - όάͷࠞೖηΩϡϦςΟϗʔϧͷϦεΫͷݮʹܨ͕Δ
- ίʔυදݱྗͷ্ - ίʔυͷҙਤΛ໌֬ʹͯ͠ՄಡੑΛ্ͤ͞Δࣄ͕Մೳ - ։ൃޮͷ্ - ReadonlyϓϩύςΟAttributeͷ༻ʹΑΓόάൃੜͷ੍ ίʔυʹҙࢥΛຒΊࠐΜͰɺίʔυΛ௨͠ඇಉظίϛϡχέʔγϣϯ͕Մೳ ݴޠදݱ͕๛͔ʹ͢Δ͜ͱͰೝෛՙΛԼ͍͖͛ͯ·͠ΐ͏
©Fusic Co., Ltd. 9 ৽ػೳͷϦετΞοϓ 2
©Fusic Co., Ltd. 10 ৽ػೳͷϦετΞοϓ - ػೳͱͯ͠ͷՃ - Ϋϥεఆͷܕ͚ -
Ϋϥεఆͷจࣈྻࢦఆ - Attribute#[\Override]ͷՃ - ಡΈऔΓઐ༻ϓϩύςΟͷσΟʔϓΫϩʔϯ - ίϚϯυϥΠϯLinterͷෳϑΝΠϧࢦఆ - ؔɺϝιουͷՃ - json_validate - Randomizer::getBytesFromString() - Randomizer::getFloat() - Randomizer::nextFloat() https://www.php.net/releases/8.3/ja.php
©Fusic Co., Ltd. 11 ৽ػೳͷϦετΞοϓ - ػೳͱͯ͠ͷՃ - Ϋϥεఆͷܕ͚ -
Ϋϥεఆͷจࣈྻࢦఆ - Attribute#[\Override]ͷՃ - ಡΈऔΓઐ༻ϓϩύςΟͷσΟʔϓΫϩʔϯ https://www.php.net/releases/8.3/ja.php
©Fusic Co., Ltd. 12 ֤ػೳͷઆ໌ͱར༻ྫ 3
©Fusic Co., Ltd. 13 Ϋϥεఆͷܕ͚ ʲbeforeʳ
©Fusic Co., Ltd. 14 Ϋϥεఆͷܕ͚ ʲbeforeʳ CacheΫϥεʹ CacheConfigΫϥε͕ઃఆΛ͢ ֦ுͨ͠ઃఆΛͦ͏ͱͨ͠ࡍʹ ఆͷܕ͚Λߦ͍ͬͯͳ͍ͨΊ
ҙਤͤ͵ܕͷఆΛઃఆ όάͷൃੜΛڐ༰͢Δࣄʹ
©Fusic Co., Ltd. 15 Ϋϥεఆͷܕ͚ ʲafterʳ
©Fusic Co., Ltd. 16 Ϋϥεఆͷܕ͚ ʲafterʳ ܕΛࢦఆ͢Δࣄ͕Մೳʹ ܕͷෆҰகʹΑΔόάΛࢭ ίʔυͷ৴པੑ্ʹܨ͕Δ ܕ͕໌ࣔ͞Ε͍ͯΔͨΊɺ
ίʔυΛಡΉ։ൃऀ͕ҙਤΛ ཧղ͘͢͠ೝෛՙΛԼ͛Δࣄʹ
©Fusic Co., Ltd. 17 Ϋϥεఆͷจࣈྻࢦఆ ʲbeforeʳ
©Fusic Co., Ltd. 18 Ϋϥεఆͷจࣈྻࢦఆ ʲbeforeʳ ఆ໊Λจࣈྻͱͯ͠ߏங -> ఆΛࢀর͢ΔؔΛར༻ ؔʹଘࡏΛ͍ͬͯΔඞཁ͕͋Γɺ
ײతͰͳ͍ͷͰೝෛՙ͕͔͔Δ
©Fusic Co., Ltd. 19 Ϋϥεఆͷจࣈྻࢦఆ ʲafterʳ
©Fusic Co., Ltd. 20 Ϋϥεఆͷจࣈྻࢦఆ ʲafterʳ ఆΛจࣈྻࢦఆ͕Մೳʹ ͱͱҎԼ͕ग़དྷ͍ͯͨͷͰ ΑΓࣗવͳܗʹͳͬͨͱߟ͑·͢ -
มͷಈతࢀর - ΦϒδΣΫτϓϩύςΟͷಈతࢀর - ੩తϓϩύςΟͷಈతࢀর
©Fusic Co., Ltd. 21 Attribute#[\Override]ͷՃ ʲbeforeʳ
©Fusic Co., Ltd. 22 Attribute#[\Override]ͷՃ ʲbeforeʳ ϝιου໊ͷλΠϓϛεͳͲʹΑΓ ҙਤͨ͠ΦʔόʔϥΠυ͕ࣦഊ͠ɺ ҙਤ͠ͳ͍ಈ࡞ͱͳΔ͜ͱ͕͋Δ ࠨͷίʔυͷ߹ɺλΠϙʹΑΓ
CacheΫϥεΛ֦ுͯ͠ར༻͍͕ͨ͠ ଆͷBaseCacheͷsetCacheLifetime ͕࠾༻͞Εͯ͠·͍ɺόάͷݪҼʹ
©Fusic Co., Ltd. 23 Attribute#[\Override]ͷՃ ʲafterʳ
©Fusic Co., Ltd. 24 Attribute#[\Override]ͷՃ ʲafterʳ #[\Override]ͱ͍͏Attribute͕Ճ Classinterfaceʹಉ͡Method͕ ఆٛ͞Ε͍ͯͳ͍߹Τϥʔ͕ൃੜ ҾΓ͕ؒҧ͍ͬͯΔ߹
ݩͷϝιου͕มߋ͞Εͨ߹༗ޮ Fatal error: ExtendedCache::setCatLifetime() has #[\Override] attribute, but no matching parent method exists
©Fusic Co., Ltd. 25 ಡΈऔΓઐ༻ϓϩύςΟͷσΟʔϓΫϩʔϯʲbeforeʳ
©Fusic Co., Ltd. 26 ಡΈऔΓઐ༻ϓϩύςΟͷσΟʔϓΫϩʔϯʲbeforeʳ readonlyෆมੑΛอͭͨΊʹ ඇৗʹ༗༻ͳػೳ ࠨͷ߹ΫϥεΦϒδΣΫτੜ -> Ωϟογϡੜͱ͍͏ߟ͑
ઃఆΛҾ͖ܧ͙ҝclone͕ͨ͠ ݁ՌΩϟογϡੜ࣌ࠁҾ͖ܧ͗
©Fusic Co., Ltd. 27 ಡΈऔΓઐ༻ϓϩύςΟͷσΟʔϓΫϩʔϯʲafterʳ
©Fusic Co., Ltd. 28 ಡΈऔΓઐ༻ϓϩύςΟͷσΟʔϓΫϩʔϯʲafterʳ cloneͷ࣌__cloneͰͷΈ ReadonlyϓϩύςΟॳظԽՄೳ Clone࣌ʹΩϟογϡੜ࣌ࠁΛ ࠶ॳظԽ͢Δ͜ͱͰ Cloneݩͱผ࣌ࠁʹ͢Δ͜ͱʹޭ
©Fusic Co., Ltd. 29 ͦͷଞͷมߋɺՃؔ͋Γ·͢ ϦϦʔεαΠτChangeLogΛνΣοΫ͠·͠ΐ͏ʂ
©Fusic Co., Ltd. 30 PHP8.4Λ͘ 4
©Fusic Co., Ltd. 31 ϓϩύςΟϑοΫ
©Fusic Co., Ltd. 32 ϓϩύςΟϑοΫ __get ϝιου ϓϩύςΟͷಡΈऔΓ࣌ʹݺͼग़͞ΕΔ __set ϝιου
ϓϩύςΟͷॻ͖ࠐΈ࣌ʹݺͼग़͞ΕΔ __isset ϝιου isset ؔ empty ؔͰ ϓϩύςΟͷଘࡏ֬ೝ࣌ʹݺͼग़͞ΕΔ
©Fusic Co., Ltd. 33 ͦͷଞʹਐΜͰ͍Δ࣮͕͋Γ·͢ https://wiki.php.net/rfc
©Fusic Co., Ltd. 34 ࠓिͷPHP Ұ෦·ͱΊͯ͘Ε͍ͯΔํ(@hanhan1978)͕͍ΔͷͰษڧʹͳΓ·͢
©Fusic Co., Ltd. 35 ΑΓޮతʹɺΑΓҙਤతʹίʔυΛॻͨ͘Ίʹ PHPͷ৽͍͠ػೳΛֶͼɺ࣮ʹऔΓೖΕΔ͜ͱ্࣭ʹܨ͕Γ·͢ ޮՌͦΕ͚ͩͰͳ͘ίʔυΛ௨ͨ͡දݱ͕͕Δ͜ͱͰ ಈ࡞Ҏ্ͷใୡ͕ՄೳʹͳΓνʔϜͰͷίʔσΟϯάޮ্͕ ৽͍͠ػೳΛ͍ͪૣ͘Γɺར༻͢Δ͜ͱະདྷͷࢿʹ
©Fusic Co., Ltd. 36 ·ͱΊ 5
©Fusic Co., Ltd. 37 ·ͱΊ PHP8.32026·Ͱར༻͠·͢ɻ͔ͬ͠Γ͖߹͍·͠ΐ͏ Point 01 ܕAttributeͰίʔυकΔͱ͍͏උ͕ਐΜͰ͓Γɺࣗͨͪʹͯඋ͢ΔࣄΛબͰ͖Δ Point
02 ࠓճՃ͞ΕͨؔҎ֎ͷͷ͋Γ·͢ʂͥͻChangeLogΛͬͯΈ·͠ΐ͏ʂ Point 03 ػೳͱͯ͠ɺίʔυӽ͠ͷҙࢥୡͷखஈͱͯ͠৽͍͠ػೳΛֶͿ͜ͱ༗༻ɺͥͻ͍·͠ΐ͏ Point 04
©Fusic Co., Ltd. 38 Thank You We are Hiring! https://recruit.fusic.co.jp/
͝ਗ਼ௌ͍͖ͨͩ͋Γ͕ͱ͏͍͟͝·ͨ͠