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

#phpcon 良いコードを書けるようになるコツは「エラーを気にする」 〜プログラマにとってエ...

#phpcon 良いコードを書けるようになるコツは「エラーを気にする」 〜プログラマにとってエラーとは何なのか〜

PHP Conference Japan 2023での発表資料です。
https://fortee.jp/phpcon-2023/proposal/b2568517-f8ae-4ae7-85f4-89adc624fcda

hideki kinjyo

October 08, 2023
Tweet

More Decks by hideki kinjyo

Other Decks in Programming

Transcript

  1. §1

  2. [ࣸਅ] (্) ৅ҹ ενʔϜࣜՃ࣪ث EE-RQ35ܕ/EE-RQ50ܕ औѻઆ໌ॻ (Լ) ΞΠϦεΦʔϠϚ ਅۭอଘϑʔυγʔϥʔ VPF-385T

    औѻઆ໌ॻ ࢀߟ: Ոి඼Λ҆શʹ࢖͏ͨΊͷϚʔΫʛҰൠࡒஂ๏ਓՈి੡඼ڠձ https://aeha.or.jp/safety/mark/index.html ৘ใͷ෼ྨͷྫ: ՈిͷϚχϡΞϧ : : 
  3. §3

  4. Τϥʔ͕࣍ͷʮ૝ఆ֎ʯʮᐆດʯΛݺͿ ( )  [ग़య] 
 ᴷAndreas Zeller, தా लج,

    ࠓా ণ޺, େؠ ঘ޺, ஛ా ߳බ, ٶݪ ٱඒࢠ, फܗ ࣿ৫ 
 σόοάͷཧ࿦ͱ࣮ફ ―ͳͥϓϩάϥϜ͸͏·͘ಈ͔ͳ͍ͷ͔ P3 - P4
  5. όά͸ʮൟ৩ʯ͢Δ 1 1  [ग़య] 
 ᴷ Shore, James, Warden,

    Shane, ฏು ݈ࣇ, ໦Լ ࢙඙, ࡫Ҫ ਸ࢘ 
 ΞʔτɾΦϒɾΞδϟΠϧσϕϩοϓϝϯτ : ૊৫Λ੒ޭʹಋ͘ΤΫετϦʔϜϓϩάϥϛϯά P169
  6. PHP͸Ͳ͏͖ͯͨ͠ʁˠΑ͘࿩୊ʹͳΔ΍ͭ PHP5 -> PHP7 Throwable/Error E_STRICT : E_NOTICE, E_WARNING, E_DEPRECATED

    PHP7 -> PHP8 warning -> Error PHP8 -> PHP9 Error (8.2 Deprecated) Error 
  7. ᐆດ͞ͱͷઓ͍ E_WARNING/E_NOTICE Error throw E_NOTICE (7.4 ) E_NOTICE php.ini these

    are warnings which often result from a bug in your code, but it's possible that it was intentional  ⏳estimate: 17~18 /25
  8. php-src grep 7.x NOTICE WARNING 8.x WARNING E_NOTICE/ 
 E_WARNINGͷग़ݱ਺

    git --no-pager grep E_NOTICE -- 'ext/**/*.c' | wc -l
  9. RFCͳͲ PHP: rfc:engine_warnings 
 https://wiki.php.net/rfc/engine_warnings PHP: rfc:consistent_type_errors 
 https://wiki.php.net/rfc/consistent_type_errors Pull

    requests · php/php-src 
 https://github.com/php/php-src/pulls?q=label%3A%22Warning+promotion%22 PHP: rfc:unde fi ned_property_error_promotion 
 https://wiki.php.net/rfc/unde fi ned_property_error_promotion PHP: rfc:unde fi ned_variable_error_promotion 
 https://wiki.php.net/rfc/unde fi ned_variable_error_promotion