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

PHPを書く理由、PHPを書いていて良い理由 / Reasons to write PHP a...

shiro seike
September 27, 2024

PHPを書く理由、PHPを書いていて良い理由 / Reasons to write PHP and why it is good to write PHP

PHPカンファレンス沖縄2024
https://phpcon.okinawa.jp/

shiro seike

September 27, 2024
Tweet

More Decks by shiro seike

Other Decks in Programming

Transcript

  1. ©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 ొஃ - PHPΧϯϑΝϨϯεԭೄ2024 ొஃʢͳ͏ʣ ࣗݾ঺հ ͸͡Ίʹ גࣜձࣾFusic ϓϦϯγύϧΤϯδχΞ/ΤόϯδΣϦετ
  2. ©Fusic Co., Ltd. 3 CONTENTS ໨࣍ 1. PHPΛॻ͘ཧ༝ͱPHPͷίϯηϓτ 2. PHPͷྺ࢙

    3. աڈͷPHPʹର͢ΔωΨςΟϒͳදݱ 4. վળΛଓ͚͖ͯͨPHPͷྺ࢙ 5. PHPΛࢧ͑ΔΤίγεςϜͱ։ൃऀ 6. ·ͱΊ
  3. ©Fusic Co., Ltd. 6 PHPͷಛ௃ - ։ൃޮ཰ͷߴ͞ - γϯϓϧͳจ๏͔ͭগͳ͍ίʔυྔͰWebΞϓϦέʔγϣϯΛૉૣ͘ߏஙՄೳ -

    େن໛ΤίγεςϜ - LaravelͳͲͷϑϨʔϜϫʔΫ΍OSSΛར༻༷͠ʑͳػೳΛ؆୯ʹ࣮૷Ͱ͖Δ - ίϛϡχςΟͷڧྗͳαϙʔτ - ੈքதͰଟ͘ͷ։ൃऀʹࢦࣔ͞Ε͓ͯΓɺυΩϡϝϯτͳͲ΋ॆ࣮͍ͯ͠Δ - ύϑΥʔϚϯεͱηΩϡϦςΟͷਐԽ - PHP͸ߴ଎Խͱݎ࿚Խ͠ଓ͚͍ͯΔ WordPress͸ੈքͷαΠτͷ40%Ͱར༻͞Ε͍ͯΔ࣮੷͕͋Δ PHP͸Ͳ͏΍ͬͯ͜ͷΑ͏ͳਐԽΛ਱͛ͨͷͰ͠ΐ͏͔
  4. ©Fusic Co., Ltd. 7 PHPൃද౰࣌ͷ՝୊ 1990೥୅Πϯλʔωοτ͕ٸ଎ʹීٴ࢝͠Ίͨ࣌୅ WebαΠτͷߏங͕ਐΜͰ͍͕ͨಈతίϯςϯπੜ੒͕·ͩݶఆతͩͬͨ - WebαΠτͷఏڙํ๏ -

    ੩తͳHTMLϖʔδ͔͠ఏڙͰ͖ͣɺಈతͳίϯςϯπΛఏڙͰ͖ͳ͔ͬͨ - CGIϓϩάϥϜͷෳࡶ͞ͱֶशίετͷߴ͔͞Β͘Δ΋ͷ - PHPͷΞϓϩʔν - ؆ܿͳจ๏Ͱ௿ֶ͍शίετ - ΢Σϒ։ൃʹಛԽͨ͠ػೳͷఏڙ - αʔόʔαΠυͰͷॲཧΛखܰʹ࣮ݱ
  5. ©Fusic Co., Ltd. 8 PHPͷ໨తͱઃܭࢥ૝ - ໨త - ΢Σϒ։ൃʹಛԽͨ͠αʔόʔαΠυεΫϦϓτݴޠͱͯ͠஀ੜͨ͠ -

    ಈతͳ΢ΣϒϖʔδΛ؆୯ʹ࡞੒Ͱ͖ΔΑ͏ʹ͢Δ - ίϯηϓτ: - ࢖͍΍͢͞ͱखܰ͞Λॏࢹ - ਝ଎ͳ։ൃͱଈ࣌ͷ݁ՌΛಘΒΕΔ؀ڥΛఏڙ - HTMLʹ௚઀ຒΊࠐΊΔγϯϓϧͳจ๏ - ઃܭࢥ૝: - ॳ৺ऀʹ΋਌͠Έ΍͍͢ݴޠઃܭ - ʮݱ࣮తͳ໰୊ղܾʯʹয఺Λ౰࣮ͯͨ༻ओٛ
  6. ©Fusic Co., Ltd. 9 ٕज़ࢤ޲ͱαʔϏεࢤ޲ͷΤϯδχΞ - ٕज़ࢤ޲ͷΤϯδχΞ - ৽͍ٕ͠ज़Λ௥ٻ͠ɺٕज़ͷ୳ٻ΍վળʹ৘೤Λ࣋ͭ -

    ϓϩάϥϛϯάݴޠ΍ϑϨʔϜϫʔΫͷઃܭݪཧɺ࠷ઌ୺ٕज़Ԡ༻ʹڵຯ - αʔϏεࢤ޲ͷΤϯδχΞ - αʔϏεΛਝ଎ʹϦϦʔε͠ɺϢʔβʔʹՁ஋Λಧ͚Δ͜ͱΛ༏ઌ - ٕज़͸՝୊ղܾͷखஈͱଊ͑ɺ։ൃͷޮ཰ੑͱ࣮ߦ଎౓Λॏࢹ - ڞ௨఺ - ϢʔβʔʹՁ஋Λఏڙ͢Δͱ͍͏࠷ऴ໨ඪ͸ಉ͡ - ٕज़ͷબఆͱαʔϏεఏڙͷόϥϯε͕੒ޭͷ伴
  7. ©Fusic Co., Ltd. 10 PHP͸αʔϏεࢤ޲ͷΤϯδχΞʹద͍ͯ͠Δͱݴ͑Δ - ਝ଎ͳ։ൃ - ؆ܿͳγϯλοΫεͱ௿ֶ͍शίετʹΑΓɺ։ൃ։͕࢝ਝ଎ -

    ଈ࠲ʹಈ࡞݁ՌΛ֬ೝͰ͖ɺϓϩτλΠϐϯά͕ૉૣ͘ߦ͑Δ - ๛෋ͳϥΠϒϥϦͱϑϨʔϜϫʔΫ - Laravel΍WordPressͳͲͷڧྗͳπʔϧ͕ଟ਺ଘࡏ͠ɺ։ൃޮ཰Λେ෯ʹ޲্ - σϓϩΠͷ༰қ͞ - ଟ͘ͷϗεςΟϯάαʔϏε΍Ϋϥ΢υͰඪ४αϙʔτ͞Εɺ εϜʔζͳσϓϩΠ͕Մೳ - ΠϯϑϥͷखؒΛ࠷খݶʹ཈͑ɺαʔϏε։ൃʹूதͰ͖Δ
  8. ©Fusic Co., Ltd. 11 ҰํͰPHP͸ٕज़ࢤ޲ΤϯδχΞʹ͸ܟԕ͞Ε͖ͯͨྺ࢙΋͋Δ ٕज़ࢤ޲ΤϯδχΞʹ͸ܟԕ͞Εͨʮ࣌ظʯ΋͋Γ·ͨ͠ ※ܾͯ͠ࢲࣗ਎͸൱ఆతͰ͸͋Γ·ͤΜɻ - ଞݴޠͱͷൺֱ -

    ݫີͳܕγεςϜ΍ߴ౓ͳΦϒδΣΫτࢦ޲ػೳ͕ෆे෼ͱݟΒΕ͍ͯͨ - ଎౓΁ͷෆຬ - ίϯύΠϧݴޠʹൺ΂ͨࡍͷύϑΥʔϚϯεͷ௿͕͞ࢦఠ͞Ε͍ͯͨ - ηΩϡϦςΟͷݒ೦ - աڈʹ͸ηΩϡϦςΟ໰୊͕ଟൃ͠ɺ৴པੑ΁ͷෆ͕҆͋ͬͨ - ίʔυͷ඼࣭ - ॳ৺ऀʹ༏͍͠ઃܭ͕ΤίγεςϜͷ੒ख़౓ʹ௥͍͔ͭͣɺ ௿඼࣭ͳίʔυ͕޿͕ͬͨ
  9. ©Fusic Co., Ltd. 14 Personal Home Page Tools(PHP Tools) PHP͸ݩʑʮPersonal

    Home Page Toolsʯͱͯ͠1994೥ʹRasmus Lerdorf͕࡞੒ 1995೥ʹιʔείʔυΛެ։͠ɺ։ൃऀ͕ࣗ༝ʹར༻΍վྑͰ͖ΔΑ͏ʹͨ͠ ޙʹେن໛ͳ࣮૷ͱͳΓɺಈత΢ΣϒΞϓϦ։ൃʹ׆༻͞Εͨ ࢀরɿhttps://www.php.net/manual/ja/history.php.php
  10. ©Fusic Co., Ltd. 15 groups.google.comʹ࢒͍ͬͯͨϑΥʔϥϜ 1995/06/08 16:00:00ʹ࢝Ίͯ PHP͕ੈͷதʹެ։͞Εͨ - CݴޠͰॻ͔Εͨখ͞ͳCGIπʔϧू

    - ΞΫηεϩά؅ཧ΍ ύεϫʔυอޢͳͲͷػೳΛఏڙ - GNUϥΠηϯεԼͰແྉެ։͞Εɺ ؆୯ʹΠϯετʔϧՄೳ
  11. ©Fusic Co., Ltd. 16 Personal Home Page Construction Kit 1995೥9݄ɺPHP͸Ұ࣌తʹFIʢForms

    Interpreterʣʹվ໊ Rasmus͕ίʔυΛ׬શʹॻ͖௚͠10݄ʹPHPͱͯ͠࠶ϦϦʔε ʮPersonal Home Page Construction Kitʯͱݺ͹Εͨ ҙਤతʹC෩ͷߏจΛ࠾༻͠ɺPerl΍Cͷ஌͕ࣝ͋ΔϢʔβʔ͕Ҡߦ͠΍͍͢ઃܭ ࢀরɿhttps://www.php.net/manual/ja/history.php.php
  12. ©Fusic Co., Ltd. 20 PHP 3 1998೥ɺPHP 3.0͕ਖ਼ࣜϦϦʔε͞ΕɺPHP/FI 2.0ͷޙܧʹ 9͔݄ͷެ։ςετΛܦͯɺ70,000Ҏ্ͷυϝΠϯͰ࢖༻

    ΢Σϒαʔόʔͷ໿10%ʹΠϯετʔϧ͞Εɺ޿͘ීٴ ࢀরɿhttps://www.php.net/manual/ja/history.php.php
  13. ©Fusic Co., Ltd. 21 PHP 4 1998೥ɺAndiͱZeev͕Zend EngineΛ։ൃ։࢝ ύϑΥʔϚϯε޲্Λ໨తʹɺPHP 4.0Λ2000೥ʹϦϦʔε

    PHP 4.0͸ߴ଎Խͱ৽ػೳΛଟ਺౥ࡌ͠ɺෳࡶͳΞϓϦʹ΋ରԠ ࢀরɿhttps://www.php.net/manual/ja/history.php.php
  14. ©Fusic Co., Ltd. 22 PHP 5 2004೥ʹPHP 5͕ެ։͞ΕɺZend Engine 2.0Ͱ৽ΦϒδΣΫτϞσϧΛαϙʔτ

    ։ൃνʔϜ͸਺े໊Ͱߏ੒͞ΕɺPEAR΍PECLͳͲؔ࿈ϓϩδΣΫτʹ΋ଟ਺͕ؔ༩ ੈքதͷԿԯ΋ͷυϝΠϯʹಋೖ͞Ε͍ͯΔঢ়گʹ ࢀরɿhttps://www.php.net/manual/ja/history.php.php
  15. ©Fusic Co., Ltd. 23 PHP 6 PHP 6͸UnicodeରԠͷෳࡶ͞Ͱதஅ(UTF-16ͷऔΓѻ͍ʹΑΔCPU࣌ؒ΍ϝϞϦΛେྔফඅ) ։ൃࠔ೉ʹΑΓਖ਼ࣜϦϦʔε͸அ೦͞Εͨ ओཁػೳ͸PHP

    5.3 (໊લۭؒ) ͱ PHP 5.4 (τϨΠτ ͱ഑ྻͷ "୹ॖ" ه๏)ʹ෼ׂಋೖ ࢀরɿhttps://www.php.net/manual/ja/history.php.php https://pipedot.org/story/2014-09-21/php6-abandoned-going-straight-to-php7
  16. ©Fusic Co., Ltd. 25 ඇ੔߹ੑͷ໰୊ - ؔ਺໊΍໋໊نଇͷෆ౷Ұ - ඪ४ؔ਺Ͱ΋໋໊نଇ͕Ұ؏͍ͯ͠ͳ͍ -

    εωʔΫέʔεͱΩϟϝϧέʔε͕ࠞࡏ - ྨࣅؔ਺Ͱඇਪ঑ɺਪ঑ؔ਺͕͋Δ - ໊લ͸΄΅ಉ౳ͳͷʹඇਪ঑ͷ΋ͷ΍ɺ ผ໊ͷਪ঑ؔ਺͕͋Δ - Ҿ਺ॱংͷෆ੔߹ - ಉ͡ҙຯͷҾ਺ͷॱং͕ؔ਺ʹΑͬͯҟͳΔ
  17. ©Fusic Co., Ltd. 26 աڈͷηΩϡϦςΟͷ੬ऑੑ(register_globals) - register_globalsͷ໰୊ ※ݱࡏ͸ഇࢭࡁ - GETɺPOSTɺCOOKIEͳͲͷ֎෦ೖྗ͕ࣗಈతʹάϩʔόϧม਺ͱͯ͠ѻΘΕΔ

    - ߈ܸऀ͕֎෦͔Β༧ظ͠ͳ͍ม਺Λૢ࡞ɾ্ॻ͖Ͱ͖ΔͨΊɺ ΞϓϦέʔγϣϯͷηΩϡϦςΟ͕੬ऑʹͳΓ·͢ ࢀߟϒϩάɿhttps://blog.ohgaki.net/phpa_rc_fei_a_oa_oa_fa_sa_le_acsa_oe_afp_2
  18. ©Fusic Co., Ltd. 27 աڈͷηΩϡϦςΟͷ੬ऑੑ(magic_quotes_gpc) - magic_quotes_gpcͷ໰୊ ※ݱࡏ͸ഇࢭࡁ - ֎෦ೖྗʢGETɺPOSTɺCOOKIEʣʹର͠ɺ

    γϯάϧΫΥʔτ΍μϒϧΫΥʔτΛࣗಈͰΤεέʔϓ͢Δػೳ - ೋॏΤεέʔϓ΍ෆ׬શͳΤεέʔϓ͕ݪҼͰࠞཚΛট͘ - ద੾ͳΤεέʔϓॲཧ΍੬ऑੑରࡦ࣮ࢪΛ๦͛ʹͳΔ͜ͱ΋ ͱ͖ʹ͸SQLΠϯδΣΫγϣϯͷ༠ൃʹ΋ ࢀߟϒϩάɿhttps://blog.ohgaki.net/a_ei_a_ram_ei_a_rphpa_ca_a_oa_ra_a_ra_as
  19. ©Fusic Co., Ltd. 28 ٕज़ࢤ޲ΤϯδχΞʹ͸ܟԕ͞Ε͖ͯͨྺ࢙͕͋Δ - ΦϒδΣΫτࢦ޲ػೳͷະ੒ख़ͳࠒ͕͋ͬͨ - PHP4·ͰͷΦϒδΣΫτࢦ޲ػೳ͸ݶఆత -

    ࢀর౉͠ͷ໰୊΍ෳࡶͳߏจ͕ٕज़ऀʹͱͬͯෆຬͷཁҼ - ύϑΥʔϚϯεͷ௿͞Λࢦఠ͞Ε͍ͯͨࠒ͕͋ͬͨ - ΠϯλϓϦλܕݴޠͱͯ͠ɺେن໛ΞϓϦέʔγϣϯͰ͸ ଎౓΍ϝϞϦޮ཰ʹݶք - લड़ͷඇ੔߹ੑͷ໰୊΍ɺηΩϡϦςΟ্ͷݒ೦
  20. ©Fusic Co., Ltd. 30 RFCϓϩηεͷಋೖͱPHPNGϓϩδΣΫτͷ্ཱͪ͛ PHP6ͷࣦഊ͔Βֶͼɺݱ࣮తͰޮՌతͳվળʹ஫ྗ - PHP 5.4ͷࠒ͔ΒRFCʢRequest for

    Commentsʣϓϩηεͷಋೖ - ৽͍͠ػೳ΍ݴޠͷมߋఏҊ͕ެ։͞ΕɺίϛϡχςΟશମͰٞ࿦ɾݕ౼ - ։ൃͷҙࢥܾఆ͕ಁ໌Խ͞Εɺଟ͘ͷ։ൃऀ͕ҙݟΛड़΂Δػձ͕૿Ճ - PHPNGϓϩδΣΫτ - Zend Engine 3ͷ։ൃΛਐΊͨϓϩδΣΫτ - Dmitry StogovɺNikita PopovɺZeev SuraskiͳͲͷ׆༂ PHPίϛϡχςΟͷߋͳΔਐలΛଅ͠·ͨ͠
  21. ©Fusic Co., Ltd. 31 RFCϓϩηεͷಋೖ PHP6ͷࣦഊ͔Βֶͼɺݱ࣮తͰޮՌతͳվળʹ஫ྗ - PHP 5.4ͷࠒ͔ΒRFCʢRequest for

    Commentsʣϓϩηεͷಋೖ - ৽͍͠ػೳ΍ݴޠͷมߋఏҊ͕ެ։͞ΕɺίϛϡχςΟશମͰٞ࿦ɾݕ౼ - ։ൃͷҙࢥܾఆ͕ಁ໌Խ͞Εɺଟ͘ͷ։ൃऀ͕ҙݟΛड़΂Δػձ͕૿Ճ ࢀরɿhttps://wiki.php.net/rfc/howto
  22. ©Fusic Co., Ltd. 32 PHPNGϓϩδΣΫτͷ্ཱͪ͛ PHP6ͷࣦഊ͔Βֶͼɺݱ࣮తͰޮՌతͳվળʹ஫ྗ - PHPNGϓϩδΣΫτ - Zend

    Engine 3ͷ։ൃΛਐΊͨϓϩδΣΫτ - Dmitry StogovɺNikita PopovɺZeev SuraskiͳͲͷ׆༂ ࢀরɿhttps://wiki.php.net/phpng
  23. ©Fusic Co., Ltd. 33 PHP 7 PHP 7.0͸2015೥ʹϦϦʔε͞ΕɺZend Engine 3.0ͰύϑΥʔϚϯεΛେ෯޲্

    ྫ֎ॲཧ΍64ϏοτରԠɺNULL߹ମԋࢉࢠͳͲͷ৽ػೳΛ௥Ճ ޙଓͷ7.xγϦʔζͰ΋ܕએݴ΍FFIͳͲ͕ಋೖ͞Εͨ ࢀরɿhttps://www.php.net/manual/ja/history.php.php
  24. ©Fusic Co., Ltd. 35 PHP͕ΑΓαʔϏεࢤ޲ͷΤϯδχΞదԠ͍ͯͬͨ͠ - ΦϒδΣΫτࢦ޲ͷڧԽʢPHP5ʣ - ຊ֨తͳΦϒδΣΫτࢦ޲ϓϩάϥϛϯάػೳ͕ಋೖɺϞμϯͳ։ൃʹରԠ -

    ύϑΥʔϚϯεͷ޲্ʢPHP7Ҏ߱ʣ - Zend Engineͷେ෯ͳվྑʹΑΓɺߴ଎ԽͱϝϞϦ࢖༻ྔͷ࡟ݮ͕࣮ݱ - ܕγεςϜͷಋೖ - εΧϥʔܕએݴɺ໭Γ஋ͷܕએݴɺUnion Typesɺίʔυͷ҆શੑͱՄಡੑ͕޲্ - ηΩϡϦςΟͷڧԽ - ةݥͳػೳͷഇࢭͱσϑΥϧτઃఆͷվળʹΑΓɺηΩϡϦςΟϦεΫ͕ܰݮ - ίϛϡχςΟͷ੒ख़ - PSRʹΑΔඪ४ԽɺϕετϓϥΫςΟεͷڞ༗
  25. ©Fusic Co., Ltd. 36 ٕज़ࢤ޲ΤϯδχΞ΋ຬ଍Ͱ͖ΔPHP΁ - ߴ౓ͳΦϒδΣΫτࢦ޲ػೳ - ໊લۭؒɺτϨΠτɺಗ໊ΫϥεͳͲͷಋೖͰɺ ෳࡶͳΞϓϦέʔγϣϯઃܭ͕Մೳ

    - ࠷৽ͷݴޠػೳ - δΣωϨʔλ΍ΞτϦϏϡʔτͱ͍ͬͨػೳΛ࠾༻͠ɺ ίʔυͷޮ཰ͱॊೈੑΛ޲্ - ύϑΥʔϚϯεͷ͞ΒͳΔ޲্ʢPHP8ʣ - JITίϯύΠϧͷಋೖʹΑΓɺҰ෦ͷϢʔεέʔεͰύϑΥʔϚϯε͕޲্
  26. ©Fusic Co., Ltd. 38 PHPͷ։ൃΛࢧ͑Δྗ - Composer - ෳ਺ͷ֎෦ϥΠϒϥϦͷґଘؔ܎؅ཧΛߦͬͯ͘ΕΔ -

    ࣗಈతʹґଘؔ܎Λղܾ͠ɺόʔδϣϯ؅ཧΛ༰қʹ ݁Ռͱͯ͠ɺPHPίϛϡχςΟͷ։ൃऀ͕ఏڙ͢Δ ༷ʑͳOSSΛ؆୯ʹ૊ΈࠐΉ͜ͱ͕ग़དྷΔ͜ͱͰ ։ൃޮ཰ͷ޲্Λߦ͏͜ͱ͕ग़དྷΔ
  27. ©Fusic Co., Ltd. 39 PHP-FIGʹΑΔPHPඪ४ԽʢPSRʣ - PHP Framework Interop Group

    (PHP-FIG) - PHPϑϨʔϜϫʔΫ΍ϥΠϒϥϦؒͷ૬ޓӡ༻ੑΛ֬อ͠ɺ ։ൃऀ͕ෳ਺ͷϑϨʔϜϫʔΫ΍ϥΠϒϥϦΛ ૊Έ߹Θͤͯ࢖͑ΔΑ͏ʹ͢ΔͨΊʹઃཱ - PHP Standards Recommendations (PSR) - PHP-FIGʹΑͬͯఏҊ͞ΕΔඪ४తͳΨΠυϥΠϯ΍ن֨ - PSRʹ४ڌ͢Δ͜ͱͰɺҟͳΔϑϨʔϜϫʔΫ΍ϥΠϒϥϦ͕ Ұ؏ੑΛ࣋ͬͯಈ࡞͢Δ͜ͱ͕Մೳ
  28. ©Fusic Co., Ltd. 40 Accepted PSR - PSR-1: جຊతͳίʔσΟϯάඪ४ -

    PSR-3: ϩΪϯάΠϯλʔϑΣʔεͷඪ४ - PSR-4: ΦʔτϩʔσΟϯάͷඪ४ - PSR-6: ΩϟογϡΠϯλʔϑΣʔεͷඪ४ - PSR-7: HTTPϝοηʔδΠϯλʔϑΣʔεͷඪ४ - PSR-11: ίϯςφΠϯλʔϑΣʔεͷඪ४ - PSR-12: ֦ு͞ΕͨίʔσΟϯάελΠϧΨΠυ - PSR-13: ϦϯΫ࢓༷ͷඪ४ - PSR-14: ΠϕϯτσΟεύονϟʔͷඪ४ - PSR-15: HTTPαʔόʔϛυϧ΢ΣΞͷඪ४ - PSR-16: γϯϓϧͳΩϟογϡͷඪ४ - PSR-17: HTTPϑΝΫτϦʔΠϯλʔϑΣʔεͷඪ४ - PSR-18: HTTPΫϥΠΞϯτͷඪ४ ࢀরɿhttps://www.php-fig.org/psr/
  29. ©Fusic Co., Ltd. 43 ϑϨʔϜϫʔΫʹΑΔ։ൃ଎౓޲্ʢDB઀ଓͷྫʣ - σʔλϕʔε৘ใͷઃఆ - σʔλϕʔε઀ଓ৘ใΛઃఆ -

    PDOͰDB઀ଓ࡞੒ - PDOΛ࢖༻ͯ͠DBʹ઀ଓ - ΤϥʔϞʔυઃఆ - ΤϥʔϞʔυΛྫ֎ʹઃఆ - SQLΫΤϦ४උ - IdΛ৚݅ʹΫΤϦΛ४උ - SQLΫΤϦ࣮ߦ - ΫΤϦΛ࣮ߦ͠σʔλऔಘ - ݁Ռͷऔಘ - ΫΤϦ݁Ռ͔ΒϢʔβʔ৘ใऔಘ - ྫ֎ॲཧ - DB઀ଓΤϥʔ࣌ʹΤϥʔϝοηʔδදࣔ
  30. ©Fusic Co., Ltd. 49 ·ͱΊ PHP͸ͦͷྺ࢙ͷதͰਐԽΛଓ͚ɺύϑΥʔϚϯε΍ηΩϡϦςΟͷ໘Ͱେ෯ͳվળΛ࣮ݱ Point 01 ٕज़ࢤ޲ͷਂ͍ΤϯδχΞͱɺαʔϏεࢤ޲ͷ։ൃऀ૒ํʹରԠͰ͖Δॊೈੑ͕͋Δ Point

    02 ๛෋ͳϑϨʔϜϫʔΫͱ׆ൃͳίϛϡχςΟͷࢧԉʹΑΓɺ։ൃͷޮ཰Խͱඪ४Խ͕ਐΜͰ͍Δ Point 03 ͥͻPHPerͱͯ͠શੈքϨϕϧͰͷPHPίϛϡχςΟΛࢧ͑Δ׆ಈΛݕ౼͍ͩ͘͞ Point 04