PHP の現場から

Ca17a082a30f4cbfed1d0a6dacbe3af2?s=47 shin1x1
July 15, 2017

PHP の現場から

2017/07/15 PHP カンファレンス関西 2017 https://2017.kphpug.jp/

Ca17a082a30f4cbfed1d0a6dacbe3af2?s=128

shin1x1

July 15, 2017
Tweet

Transcript

  1. ɹ!shin1x1 2017//15 PHPΧϯϑΝϨϯεؔ੢ 1)1ͷݱ৔͔Β

  2. http://php-genba.shin1x1.com/

  3. D .BTBTIJ4IJOCBSB!TIJOY ΞδΣϯμ wॆ࣮ͨ͠υΩϡϝϯτ wܕΛ໌ࣔͰ͖ΔεΫϦϓτݴޠ wΦϒδΣΫτࢦ޲։ൃݴޠ wεςʔτϨεͳϥϯλΠϜ w1)1ͷࢥ૝

  4. ॆ࣮ͨ͠ υΩϡϝϯτ

  5. http://php.net/

  6. http://ja.phptherightway.com/

  7. ܕΛ໌ࣔͰ͖Δ εΫϦϓτݴޠ

  8. None
  9. &MPRVFOU 3FQPTJUPSZ <?php function something(int $i): Foo {} something(1)->method(); ܕએݴ

  10. &MPRVFOU 3FQPTJUPSZ <?php // PHP 7.1 function something(?int $i): ?Foo

    {} // PHP 7.0 ҎԼ function something(int $i = null): Foo {} ܕએݴʢOVMMBCMFʣ
  11. D .BTBTIJ4IJOCBSB!TIJOY ܕΛ໌ࣔ͢Δ wҙਤ͠ͳ͍஋ʢܕʣΛ๷͙ wίʔυͷҙਤΛ໌֬ʹʢ*%&ʹ΋ڭ͑Δʣ w҉໧తม׵Λ๷͙

  12. D .BTBTIJ4IJOCBSB!TIJOY ܕͷݕࠪ w*%&ʢ1IQ4UPSN/FU#FBOT౳ʣ w1IBOͳͲͷ੩తղੳπʔϧ wࣗಈςετ

  13. ΦϒδΣΫτࢦ޲։ൃݴޠ

  14. D .BTBTIJ4IJOCBSB!TIJOY ΦϒδΣΫτࢦ޲։ൃݴޠ wΫϥεɺܧঝɺΧϓηϧԽ wܕએݴ wΠϯλʔϑΣΠεɺந৅Ϋϥε wྫ֎ɺτϨΠτ

  15. D .BTBTIJ4IJOCBSB!TIJOY ׆༻Ͱ͖Δ؀ڥ w044ͷϥΠϒϥϦɺϑϨʔϜϫʔΫ w%%%ͷྲྀߦʹΑΔ001ͷ࠶ධՁ w৘ใɺϊ΢ϋ΢ͷެ։

  16. D .BTBTIJ4IJOCBSB!TIJOY 1)1ݴޠػೳͰͷ׆༻ wෳࡶͳ࣮૷ΛӅͯ͠ɺ୯७ͳݴޠػೳͰར༻ w"SSBZ"DDFTT<>ʹΑΔཁૉΞΫηε w5SBWFSTBCMFGPSFBDIͰΠςϨʔτ

  17. &MPRVFOU 3FQPTJUPSZ <?php class FooCollection implements \ArrayAccess { // (snip)

    } $collection = new FooCollection(); $collection['key1'] = 'foo'; $value = $collection[‘key1']; "SSBZ"DDFTT
  18. s &MPRVFOU 3FQPTJUPSZ <?php class BarCollection implements \IteratorAggregate { //

    (snip) } $collection = new BarCollection(); foreach ($collection as $v) { echo $v; } 5SBWFSTBCMF *UFSBUPS"HHSFHBUF
  19. εςʔτϨεͳ ϥϯλΠϜ

  20. D .BTBTIJ4IJOCBSB!TIJOY 1)1ͷ࣮ߦNPE@QIQQIQGQN )551ϦΫΤετདྷΔ 1)1ίʔυΛίϯύΠϧʢPQDPEFੜ੒ʣ ࣮ߦ؀ڥΛॳظԽ PQDPEFΛ࣮ߦ )551Ϩεϙϯεฦ͢

  21. D .BTBTIJ4IJOCBSB!TIJOY 1)1ͷ࣮ߦNPE@QIQQIQGQN )551ϦΫΤετདྷΔ 1)1ίʔυΛίϯύΠϧʢPQDPEFੜ੒ʣ ࣮ߦ؀ڥΛॳظԽ PQDPEFΛ࣮ߦ )551Ϩεϙϯεฦ͢ 01$BDIFͰΩϟογϡ

  22. D .BTBTIJ4IJOCBSB!TIJOY 1)1ͷ࣮ߦNPE@QIQQIQGQN )551ϦΫΤετདྷΔ 1)1ίʔυΛίϯύΠϧʢPQDPEFੜ੒ʣ ࣮ߦ؀ڥΛॳظԽ PQDPEFΛ࣮ߦ )551Ϩεϙϯεฦ͢

  23. D .BTBTIJ4IJOCBSB!TIJOY εςʔτϨεͳϥϯλΠϜ w୯ҰϦΫΤετͰด͍ͯ͡Δ wϦΫΤετຖʹϦηοτ wԿ΋ڞ༗͠ͳ͍ɺԿ΋࢒͞ͳ͍

  24. D .BTBTIJ4IJOCBSB!TIJOY ϝϦοτ wϦΫΤετͰඞཁͳϝϞϦ͔͠࢖Θͳ͍ wϝϞϦϦʔΫɺ($͕ى͜Γʹ͍͘ w͏͔ͬΓσʔλΛڞ༗ͯ͠ͷࣄނ͕ແ͍ wΞϓϦέʔγϣϯ։ൃʹ͚ͩूதͰ͖Δ

  25. D .BTBTIJ4IJOCBSB!TIJOY ࠓͷைྲྀͱͷ਌࿨ੑ wΫϥ΢υɺαʔόʔϨε w࢖͏ͱ͖ʹੜ੒ɺऴΘͬͨΒഁغ w5IF5XFMWF'BDUPS"QQ

  26. 1)1ͷࢥ૝

  27. 1)1͸ࣃϒϥγ ͷΑ͏ͳ΋ͷͰ͢ ϥεϚεɾϥʔυϑ https://www.sitepoint.com/phps-creator-rasmus-lerdorf/

  28. ʮ1)1ͱ͍͏ݴޠΛ࡞Ζ͏ʯ
 ͱߟ͑ͯ࡞ͬͨͷͰ͸͋Γ·ͤΜɻ
 ʮ໰୊Λղܾ͢ΔͨΊͷπʔϧΛ࡞Ζ͏ʯ
 ͱࢥͬͯ࡞͍ͬͯ·ͨ͠ɻ ϥεϚεɾϥʔυϑ http://gihyo.jp/news/interview/2010/rasmus

  29. 1)1πʔϧ

  30. ୭΋͕࢖͑Δπʔϧ

  31. 1)1ܨ͙ݴޠ

  32. 1)1ΤϯδχΞΑ ڳΛுΕ

  33. D .BTBTIJ4IJOCBSB!TIJOY !TIJOY !TIJOY D .BTBTIJ4IJOCBSB!TIJOY