Upgrade to Pro — share decks privately, control downloads, hide ads and more …

PHP8をざっくり解説してみる

 PHP8をざっくり解説してみる

Ca1357a6e793898d30cec23068c3cb36?s=128

大塚真言

January 23, 2021
Tweet

Transcript

  1. PHP8Λͬ͘͟Γղઆͯ͠ΈΔ 2021/1/22 WebφΠτٶ࡚ vol.12 େ௩ਅݴ

  2. ࣗݾ঺հ

  3. ࣗݾ঺հ -BSBWFM 7VFKT 'JSFCBTF α΢φେ޷͖ͳ8FCΤϯδχΞ

  4. ձࣾ঺հ ߹ಉձࣾϊϚυϦ ૑ۀظ໨ ϝϯόʔ໊ 8FCαʔϏε։ൃ &$αΠτ։ൃ

  5. 2020೥11݄26೔͸ Կͷ೔ʁ

  6. ๻ͷ஀ੜ೔

  7. Ͱ͸ͳ͘

  8. PHP8ͷ஀ੜ೔ ʢϦϦʔε೔ʣ

  9. ओͳมߋ఺ • JITίϯύΠϧʹΑΔੑೳվળ • Nullsafeԋࢉࢠʢψϧ҆શΦϖϨʔλʣ • Unionܕ • Matchࣜ •

    ଞʹ΋ଟ਺
  10. ͦͷલʹ Ξϯέʔτ

  11. ͲͷόʔδϣϯΛ࢖ͬͯΔʁ 1. PHP 5.x 2. PHP 7.0ʙ7.2 3. PHP 7.3ʙ7.4

    4. PHP 8.0
  12.          

     ҎԼ 7.4 7.3 7.2 7.0-7.1 5.6 5.5ҎԼ IUUQTXUFDITDPNUFDIOPMPHJFTEFUBJMTQMQIQ όʔδϣϯ͝ͱͷ࢖༻཰
  13. PHP8ͷ৽ػೳ

  14. JITίϯύΠϧ • JITʢJust-in-Time Compilerʣ˞࣮ߦ࣌ίϯύΠϥ • ίʔυΛϝϞϦʔʹΩϟογϡ͢ΔOPCacheͱซ༻ • ωΠςΟϒίʔυΛϝϞϦʔʹΩϟογϡ͢Δ͜ͱͰϓϩ άϥϜ࣮ߦΛߴ଎Խ •

    ΞϧΰϦζϜܥॲཧͰ͸2~3ഒఔ౓࣮ߦ଎౓͸޲্͕ͨ͠ɺ WordPressͳͲͷWebΞϓϦέʔγϣϯͰ͸਺%ఔ౓͔͠ ޲্͠ͳ͍
  15. Nullsafeԋࢉࢠ DPVOUSZOVMM JG TFTTJPOOVMM \ VTFSTFTTJPOVTFS JG VTFSOVMM \ BEESFTTVTFSHFU"EESFTT

      JG BEESFTTOVMM \ DPVOUSZBEESFTTDPVOUSZ ^ ^ ^ DPVOUSZTFTTJPO VTFS HFU"EESFTT DPVOUSZ 1)1 1)1 ifจʹΑΔnullνΣοΫ͕ෆཁʹͳΔ
  16. Unionܕ    !QBSBNqPBUcJOUOVNCFS   QVCMJDGVODUJPOTBNQMF OVNCFS \

    FDIPOVNCFS ^ UIJTTBNQMF UFHFIPHF ࣮ߦՄೳ QVCMJDGVODUJPOTBNQMF qPBUcJOUOVNCFS \ FDIPOVNCFS ^ UIJTTBNQMF UFHFIPHF ࣮ߦΤϥʔ 1)1 1)1 ࣮ߦ࣌ʹUnionܕͷܕνΣοΫ͕Ͱ͖Δ 1)1Ͱ͸Ξϊςʔγϣϯ ʹΑΔิ׬
  17. Matchࣜ TXJUDI  \ DBTF SFTVMU0IOP CSFBL DBTF SFTVMU5IJTJTXIBU*FYQFDUFE CSFBL

    ^ FDIPSFTVMU 0IOP FDIPNBUDI  \ 0IOP  5IJTJTXIBU*FYQFDUFE  ^ 5IJTJTXIBU*FYQFDUFE 1)1 1)1 ݫີͳൺֱɺbreakจ͕ෆཁ
  18. ·ͱΊ • JITίϯύΠϧ͕ಋೖ͞Ε͕ͨɺ࣮ӡ༻ͷWebΞ ϓϦ΁ͷੑೳ޲্͸͋·Γظ଴Ͱ͖ͳ͍ • Matchࣜ΍NullsafeԋࢉࢠΛ࢖͏͜ͱͰεϦϜ ͳίʔυΛॻ͚Δ • Unionܕ͕௥Ճ͞ΕɺܕγεςϜ͕ΑΓڧݻʹ ͳͬͨ

  19. ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ