Skip to content
Artwork for PHPの現場
PHPの現場 · Dec 21, 2020 · 1 hr 26 min

41. PHP 8(sji_ch)

@sji_ch さんと PHP 8 について話しました。 PHP カンファレンス 2020 オンライン登壇 ライブ感 PHP 8 の印象 match 式 これまで PHP に無かった書き味 網羅性チェック Ilija Tovilo さん作 静的解析 get_debug_type() Constuructor property promotion コードボリュームが減る プロパティ宣言との混在 Named argument 仮引数の名前が API の一部になる 継承関係でも仮引数を揃える needle / haystack PhpStorm(JetBrains) の貢献がすごい Attribute 仕組みが入った 静的解析に使うか Psalm は doc comment 推奨 動作に影響を及ぼすところに使う Union types type alias が欲しい レガシーコードへの適用 現場でどう使わるか Nullsafe operator 便利は便利 真面目に書く時に使うか コードレビューで通すか Saner string to number comparisons リリース時の反応 覚えるパターンが増えた 挙動が変わるので、PHP 8 対応時は要注意 in_array や sort なども影響 Jit compilation なぜ JSON パーサが速くならなったか プロファイルでボトルネックを見つける CPU bound でも速くならないケース ファミコンエミュレータ $x === null or is_null($x) Weap Map わくわくするが、どこで使うか 今後の PHP PHP 8 リリースまでの流れ 誰が今後の旗振り役をするのか 進化しつづける PHP Show notes PHP Conference Japan 2020 Re:born PHP 8 で作る JSON パーサ / php8-json-parser - Speaker Deck PHP 8 で Web 以外の世界の扉を叩く PHP: PHP 8.0.0 Release Announcement PHP: rfc:match_expression_v2 PHP: rfc:get_debug_type PHP: rfc:constructor_promotion PHP: rfc:attributes_v2 Add very basic draft of some PHP 8 attributes by unkind · Pull Request #1218 · php-fig/fig-standards Psalm supports PHP 8 Attributes Early Access Program for Qodana, a New Static Analysis and Quality Management Tool by JetBrains, Is Open | JetBrains Blog PHP: rfc:union_types_v2 PHP: rfc:nullsafe_operator PHP: rfc:string_to_number_comparison PHP: rfc:jit shin1x1/php8-toy-json-parser sj-i/php-profiler: a sampling profiler for php php-src/zend_compile.c at PHP-8.0 · php/php-src PHP: rfc:weak_maps

0:00-1:26:46

transcript

No transcript — this publisher did not publish one.

show notes

@sji_ch さんと PHP 8 について話しました。

  • PHP カンファレンス 2020
    • オンライン登壇
    • ライブ感
  • PHP 8 の印象
  • match 式
    • これまで PHP に無かった書き味
    • 網羅性チェック
    • Ilija Tovilo さん作
    • 静的解析
    • get_debug_type()
  • Constuructor property promotion
    • コードボリュームが減る
    • プロパティ宣言との混在
  • Named argument
    • 仮引数の名前が API の一部になる
    • 継承関係でも仮引数を揃える
    • needle / haystack
    • PhpStorm(JetBrains) の貢献がすごい
  • Attribute
    • 仕組みが入った
    • 静的解析に使うか
    • Psalm は doc comment 推奨
    • 動作に影響を及ぼすところに使う
  • Union types
    • type alias が欲しい
    • レガシーコードへの適用
    • 現場でどう使わるか
  • Nullsafe operator
    • 便利は便利
    • 真面目に書く時に使うか
    • コードレビューで通すか
  • Saner string to number comparisons
    • リリース時の反応
    • 覚えるパターンが増えた
    • 挙動が変わるので、PHP 8 対応時は要注意
    • in_array や sort なども影響
  • Jit compilation
    • なぜ JSON パーサが速くならなったか
    • プロファイルでボトルネックを見つける
    • CPU bound でも速くならないケース
    • ファミコンエミュレータ
    • $x === null or is_null($x)
  • Weap Map
    • わくわくするが、どこで使うか
  • 今後の PHP
    • PHP 8 リリースまでの流れ
    • 誰が今後の旗振り役をするのか
    • 進化しつづける PHP

Show notes

links20