$30 off During Our Annual Pro Sale. View Details »

PHP8.3の機能を振り返る / Review of PHP 8.3 features

PHP8.3の機能を振り返る / Review of PHP 8.3 features

PHPカンファレンス小田原2024
https://phpcon-odawara.jp/2024

shiro seike

April 13, 2024
Tweet

More Decks by shiro seike

Other Decks in Programming

Transcript

  1. ©Fusic Co., Ltd. 2 ਗ਼Ո ࢙࿠ @seike460 AWS Community Builder

    Serverless PHPΧϯϑΝϨϯε෱Ԭ2023 ࣮ߦҕһ௕ - ίϛϡχςΟ - Fukuoka.php - Fukuoka.go - JAWS-UG Fukuoka - Serverless Meetup Fukuoka - Cloudflare Meetup Fukuoka - JP_Stripes Fukuoka ࣗݾ঺հ ͸͡Ίʹ גࣜձࣾFusic ϓϦϯγύϧΤϯδχΞ/ΤόϯδΣϦετ
  2. ©Fusic Co., Ltd. 5 PHP8.3ͷϦϦʔεʹ͍ͭͯৼΓฦΔ - PHP 8.3.0 - 2023೥11݄23೔

    - PHP 8.3.1 - 2023೥12݄21೔ - PHP 8.3.2 - 2024೥1݄18೔ - PHP 8.3.3 - 2024೥2݄15೔ - PHP 8.3.4 - 2024೥3݄14೔ - PHP 8.3.6ɹɹɹɹ˞PHP8.3.5͸ReleasePage͔Βফ͍͑ͯͨ - 2024೥4݄11೔ʢNewʂʣ
  3. ©Fusic Co., Ltd. 6 PHP8.3ͷαϙʔτظݶ - Active Support - 2025೥11݄23೔

    ࠓ೔͔Β590೔ - Security Support - 2026೥11݄23೔ ࠓ೔͔Β955೔ ͭ·ΓPHPΧϯϑΝϨϯεখాݪ2024 ͔Β590೔ɺ955೔ͱ͓͍֮͑ͯͯ ࢥ͍ग़ͤΔΑ͏ʹ͓͖ͯ͠·͠ΐ͏
  4. ©Fusic Co., Ltd. 8 ৽ػೳͷϦετΞοϓ - ػೳͱͯ͠ͷ௥Ճ - Ϋϥεఆ਺ͷܕ෇͚ -

    Ϋϥεఆ਺ͷจࣈྻࢦఆ - Attribute#[\Override]ͷ௥Ճ - ಡΈऔΓઐ༻ϓϩύςΟͷσΟʔϓΫϩʔϯ - ίϚϯυϥΠϯLinterͷෳ਺ϑΝΠϧࢦఆʢࠓճׂѪʣ - ؔ਺ɺϝιουͷ௥Ճ - json_validate - Randomizer::getBytesFromString() - Randomizer::getFloat() - Randomizer::nextFloat() https://www.php.net/releases/8.3/ja.php
  5. ©Fusic Co., Ltd. 15 Ϋϥεఆ਺ͷจࣈྻࢦఆ - خ͍͠ར༻έʔε Enum ಛʹEnumΛར༻͢Δέʔε͕خ͍͠ ࣍ͷΑ͏ʹ࣮૷͢Δ͜ͱ΋ग़དྷΔͷͰ

    EnumΛඇৗʹར༻͠΍͘͢ͳΓ·͢ (͜Ε΋ͬͱૣ͘ཉ͔ͬͨ͠ͳ͊…) ͜ͷ࣮૷ʹΑΓདྷ೥ʹͳΔͱࣗಈతʹ PHPConference Odawara 2025ʹͳΓ ͋ͱ͸interfaceΛ࣮૷͢Δͱ ։࠵ՄೳʹͳΓ·͢
  6. ©Fusic Co., Ltd. 18 Attribute#[\Override]ͷ௥Ճ - ๷͛ΔBadέʔε #[\Override]ͱ͍͏Attribute͕௥Ճ ਌Class΍interfaceʹಉ͡Method͕ ఆٛ͞Ε͍ͯͳ͍৔߹Τϥʔ͕ൃੜ

    Ҿ਺΍໭Γ஋͕ؒҧ͍ͬͯΔ৔߹΍ ݩͷϝιου͕มߋ͞Εͨ৔߹΋༗ޮ Fatal error: Tests\Unit\ExampleTest::setUpp() has #[\Override] attribute, but no matching parent method exists
  7. ©Fusic Co., Ltd. 27 ύϑΥʔϚϯεͷൺֱ - ։࢝࣌ؒΛܭଌ - 50ͷFiberΛ༻ҙ͢Δ -

    ฏํࠜΛ100000000ճ࣮ߦΛ࢓ࠐΉ - ऴྃ࣌ؒΛܭଌ
  8. ©Fusic Co., Ltd. 33 ·ͱΊ PHP8.3͸PHPΧϯϑΝϨϯεখాݪ2024͔Β955೔ͷ෇͖߹͍Ͱ͢ɻ͔ͬ͠Γ޲͖߹͍·͠ΐ͏ Point 01 ܕ΍AttributeͰίʔυकΔͱ͍͏੔උ͕ਐΜͰ͓Γɺࣗ෼ͨͪʹͯ੔උ͢ΔࣄΛબ୒Ͱ͖Δɻ Point

    02 ࠓճ௥Ճ͞Εͨؔ਺Ҏ֎ͷ΋ͷ΋͋Γ·͢ʂͥͻChangeLogΛ௥ͬͯΈ·͠ΐ͏ʂ Point 03 एׯPHP8.3ͷํ͕ૣ͘ͳ͍ͬͯΔࣄ͕ݟ͑ͨɺͰ΋Ξοϓσʔτͷ໨తʹ͢Δ΄ͲͰ͸͋Γ·ͤΜɻ Point 04