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
400
有効な使い方を正しく理解して実装する 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
(再)ひとり技術広報からの脱却 / Re:Breaking away from one-man technical public relations
seike460
PRO
1
91
PHPで作るWebSocketサーバー ~リアクティブなアプリケーションを知るために~ / WebSocket Server in PHP - To know reactive applications
seike460
PRO
2
780
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
240
AWS reInvent 2024サービスアップデートデモ / AWS reInvent 2024 Service Update Demo
seike460
PRO
0
36
AWS Lambdaから始まった Serverlessの「熱」とキャリアパス / It started with AWS Lambda Serverless “fever” and career path
seike460
PRO
1
590
とにかく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
370
PHPを書く理由、PHPを書いていて良い理由 / Reasons to write PHP and why it is good to write PHP
seike460
PRO
5
640
AWS CDKを用いたセキュアなCI/CDパイプラインの構築 / Build a secure CI/CD pipeline using AWS CDK
seike460
PRO
3
780
Other Decks in Programming
See All in Programming
AWS Lambda functions with C# 用の Dev Container Template を作ってみた件
mappie_kochi
0
170
DMMオンラインサロンアプリのSwift化
hayatan
0
190
毎日13時間もかかるバッチ処理をたった3日で60%短縮するためにやったこと
sho_ssk_
1
560
[JAWS-UG横浜 #80] うわっ…今年のServerless アップデート、少なすぎ…?
maroon1st
0
120
선언형 UI에서의 상태관리
l2hyunwoo
0
270
アクターシステムに頼らずEvent Sourcingする方法について
j5ik2o
6
710
ecspresso, ecschedule, lambroll を PipeCDプラグインとして動かしてみた (プロトタイプ) / Running ecspresso, ecschedule, and lambroll as PipeCD Plugins (prototype)
tkikuc
2
2k
カンファレンス動画鑑賞会のススメ / Osaka.swift #1
hironytic
0
180
快速入門可觀測性
blueswen
0
500
EC2からECSへ 念願のコンテナ移行と巨大レガシーPHPアプリケーションの再構築
sumiyae
3
600
見えないメモリを観測する: PHP 8.4 `pg_result_memory_size()` とSQL結果のメモリ管理
kentaroutakeda
0
950
サーバーゆる勉強会 DBMS の仕組み編
kj455
1
310
Featured
See All Featured
Speed Design
sergeychernyshev
25
740
Building Adaptive Systems
keathley
38
2.4k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
Writing Fast Ruby
sferik
628
61k
Adopting Sorbet at Scale
ufuk
74
9.2k
Typedesign – Prime Four
hannesfritz
40
2.5k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
3
360
Why Our Code Smells
bkeepers
PRO
335
57k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.2k
Building an army of robots
kneath
302
45k
Learning to Love Humans: Emotional Interface Design
aarron
274
40k
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/
͝ਗ਼ௌ͍͖ͨͩ͋Γ͕ͱ͏͍͟͝·ͨ͠