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
PHPで作るWebSocketサーバー ~リアクティブなアプリケーションを知るために~ / WebSocket Server in PHP - To know reactive applications
seike460
PRO
2
720
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
230
AWS reInvent 2024サービスアップデートデモ / AWS reInvent 2024 Service Update Demo
seike460
PRO
0
28
AWS Lambdaから始まった Serverlessの「熱」とキャリアパス / It started with AWS Lambda Serverless “fever” and career path
seike460
PRO
1
580
とにかく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
630
AWS CDKを用いたセキュアなCI/CDパイプラインの構築 / Build a secure CI/CD pipeline using AWS CDK
seike460
PRO
3
770
いまあるチームにフィットさせる Serverless そして Platform Engineeringへの挑戦 / Serverless Fits the Team You Have and Platform Engineering
seike460
PRO
2
2.1k
Other Decks in Programming
See All in Programming
Package Traits
ikesyo
1
130
MCP with Cloudflare Workers
yusukebe
2
270
月刊 競技プログラミングをお仕事に役立てるには
terryu16
1
1.1k
menu基盤チームによるGoogle Cloudの活用事例~Application Integration, Cloud Tasks編~
yoshifumi_ishikura
0
130
php-conference-japan-2024
tasuku43
0
410
rails newと同時に型を書く
aki19035vc
5
610
良いユニットテストを書こう
mototakatsu
11
3.5k
Effective Signals in Angular 19+: Rules and Helpers
manfredsteyer
PRO
0
340
快速入門可觀測性
blueswen
0
480
責務を分離するための例外設計 - PHPカンファレンス 2024
kajitack
9
2.3k
歴史と現在から考えるスケーラブルなソフトウェア開発のプラクティス
i10416
0
240
htmxって知っていますか?次世代のHTML
hiro_ghap1
0
390
Featured
See All Featured
What's in a price? How to price your products and services
michaelherold
244
12k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
97
17k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
171
50k
Statistics for Hackers
jakevdp
797
220k
Code Reviewing Like a Champion
maltzj
521
39k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
33
2.7k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
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/
͝ਗ਼ௌ͍͖ͨͩ͋Γ͕ͱ͏͍͟͝·ͨ͠