php7に関するEggnogのブックマーク (6)

  • PHP7調査(23)致命的エラーが例外としてキャッチできるようになった - Qiita

    (2015/07/02追記:PHP 7.0.0alpha2に合わせて修正しました) PHPのエラーは、エラー文言を表示するだけの警告・注意と、その場で処理を終了してしまう致命的エラー(fatal error)の2種類に大別できます。 ところで、PHP5の致命的エラーには不便な点があります。それは、set_error_handler()やその他の方法でエラーハンドリングできず、必ず終了してしまう点です。これでは致命的エラーをユニットテストするのも不便ですし、ReactPHPのようにサーバ動作させるようなプログラムも安心して使えません。 PHP7では致命的エラーが例外として実現されるようになり、エラーハンドリングの自由度が格段に上がりました。この変更の概要を紹介します。 例外のクラス階層の変更 まず、PHP7で例外クラスの階層がどう変わるかを説明します。PHP5までの例外のクラス階層は次のよう

    PHP7調査(23)致命的エラーが例外としてキャッチできるようになった - Qiita
    Eggnog
    Eggnog 2015/05/19
    PHPでデーモン書く際に1つのリクエストのfatalで全リクエストの処理が即死したら困るとか、ユニットテストで1つfatalでもとりあえず全テスト通して実行したいとかがユースケース
  • PHP 7 at a Glance.

    PHP7 is on it’s way! This is the largest shift in the PHP landscape since the upgrade to PHP 5.3. Most of us survived that and I’m sure we will survive this one as well. To help you see the forrest for the trees, I’ve put together a list of all the RFCs that are marked as “Implemented” on the PHP wiki. Some of them have not yet been updated to “Implemented” status and there are still others in the

    PHP 7 at a Glance.
    Eggnog
    Eggnog 2015/04/13
    個人的にはuniform variable syntaxは大きい。思わぬとこでBC breakに引っかかるケースもありえる
  • PHP 7のパフォーマンスが高い理由

    CodeZine編集部では、現場で活躍するデベロッパーをスターにするためのカンファレンス「Developers Summit」や、エンジニアの生きざまをブーストするためのイベント「Developers Boost」など、さまざまなカンファレンスを企画・運営しています。

    PHP 7のパフォーマンスが高い理由
  • 【導入決定!】PHP7で実装されるスカラー型宣言とは? | 東北ギーク

    * NaN でなく PHP_INT_MIN から PHP_INT_MAX までの範囲内の値に限る ** 数値形の文字列のみ。数値形の文字列に他の文字が続く場合も使えるが、 Notice が出る *** __toString メソッドを持つもののみ 弱い型検査モードで行われる暗黙の型変換は、PHP が従来他の構文(算術演算子や条件式、組み込み関数の呼び出しなど)で行ってきたのと同等のものです。 厳密モード 一方、厳密な型検査のモードを使う場合は、関数は宣言されたのと正確に一致する型のみを受け付けるようになります(int → float の拡大変換をのぞく)。 ファイルの先頭に declare(strict_types=1); と書くことで、そのファイル内での関数呼び出しの際に厳密モードでの型検査が行われるようになります*1。 以下のように使います。 <?php declare(strict_

    【導入決定!】PHP7で実装されるスカラー型宣言とは? | 東北ギーク
  • PHP: rfc:scalar_type_hints_v5

    Author: Anthony Ferrara ircmaxell@php.net (original Andrea Faulds, ajf@ajf.me) This RFC proposes the addition of four new type declarations for scalar types: int, float, string and bool. These type declarations would behave identically to the existing mechanisms that built-in PHP functions use. This RFC further proposes the addition of a new optional per-file directive, declare(strict_types=1);, w

  • PHP 7 Feature Freeze

    Today was the feature freeze for PHP 7. That means no new votes can be started for a feature that is aimed at PHP 7.0, and would instead have to go into PHP 7.1. Instead of heading out to St Patrick's Day with a bunch of New Yorkers making dubious claims about their tenuous connection to Irish ancestry as an excuse to drink, I thought it would be a good time to review some of the more recent RFCs

  • 1