スタックパス
スタックパス
スタックパス
,

PHP 7 にアップグレードする必要があるのはなぜですか?

この記事をお楽しみいただけましたか?
Share it on social media!
コンテンツ

Developers running PHP-enabled websites such as WordPress, Drupal, Joomla, or Magento along with PHP frameworks like Laravel and Symfony should stay up-to-date with the latest version and trends in PHP. Upgrading your site to PHP 7 will ensure you get all the latest benefits and security. Learn about the benefits of PHP 7 and how to get it up and running on your website.

PHP 7の利点

使用法

About 98% of websites are still using PHP version 5.*. With PHP5 being more than 11 years old now, it’s time to upgrade to PHP 7 and clean up those obsolete functions. The PHP project has a list of 削除された機能 as well as a list of 削除されたAPIと拡張機能, which will guide you in porting PHP 5 to PHP 7 code.

Most big blog systems such as WordPress, content management systems (CMS) like Joomla, and e-commerce sites like Opencart support PHP 7 out-of-the-box. Make sure you’re running the latest version of WordPress or your CMS and switch your webserver to PHP 7. Many services updated automatically to stay on top of new releases and trends. If you are unsure what version of PHP you’re running, contact your web hosting company. Many video tutorials are available to guide you through installing or upgrading to PHP 7.

歴史

In the beginning of 2015 the first alpha of PHP 7 has been released. The first stable (v7.0.0) PHP was released December 1, 2015. Currently, the PHP community is busy with version 7.0.8 (release candidate) and 7.1.0 alpha. PHP version 7.0.7 is released as stable. Most important issues have been resolved, and PHP 7 is mature enough to use in production.

What about version 6? PHP 6 was never released, although it was in originally in development. The idea was to introduce Unicode in PHP 5, calling it PHP 6. Unicode is a computing standard for the encoding and representation of text. Due to the complexity of introducing Unicode, PHP 6 was never released. Unicode doubled the memory consumption and impacted the performance due to conversions, and PHP 6 was abandoned. Moving forward, it was decided the newest version of PHP would be named PHP 7 while skipping PHP 6 altogether.

パフォーマンス

PHP 5からPHP 7に移行する最大の理由の一つは、速度の向上です。DrupalとWordPressの測定値の比較については、以下のベンチマークをご覧ください(バーの値が大きいほどパフォーマンスが優れています)。

 

 

PHP 5 と PHP 7 の Web サイト (2 倍高速!)

PHP バージョンと HHVM (PHP 用の仮想マシン) のリクエスト/秒での別の比較 (この場合も、値が高いほど優れています)。

リクエスト/秒の別の比較。

PHP 5.6 対 HHVM 3.11 対 PHP 7.0。

PHP 5、HHVM、PHP7 間の応答時間 (短いほど良い)。

PHP 5、HHVM、PHP 7 間の応答時間。

PHP 5、HHVM、PHP7 間の応答時間。

最後に、PHP 5、HHVM、および PHP7 のメモリ使用量を RAM のメガバイト単位で比較します (少ないほど良い)。

PHP 5、HHVM、PHP 7のメモリ使用量

PHP 5、HHVM、PHP 7のメモリ使用量

何が新しいのですか?

  • 改善点performance! PHP 7 は PHP 5.6 の 2 倍の速度です。
  • 大幅reduced memory usage上で見たとおりです。
  • PHP 7 コンパイラーで使用される抽象構文ツリー (AST) データ構造。
  • 一貫した64ビットサポート
  • 例外階層の改善
  • 多くの致命的なエラーが例外に変換されるようになりました
  • 安全な乱数ジェネレータ
  • New operator: null coalescing(??) は、最初のオペランドが存在し、NULL でない場合はその結果を返し、そうでない場合は 2 番目のオペランドの結果を返します。
  • New operator: spaceship(<=>) は、最初のオペランドが 2 番目のオペランドより小さい、等しい、または大きい場合にそれぞれ -1、0、または 1 を返します。
  • Anonymous classes: クラスを文書化する必要がない場合、または一度だけ使用される場合に、名前を含まないクラスを使用できます。
  • Use define() function for defining array constants (before only const could be used).
  • Scalar Type declarations関数が実行時に特定の型のパラメータを必要とすることを可能にします。
  • Return Type declarations関数が指定された型を返すことを許可します。
  • その他にも多数…

ダウンロード

You can download the 公式サイトから最新のPHP 7バージョンを入手.

If you have a Debian server running with PHP, try-out ドットデブ, which provides up-to-date packages (32bit & 64 bit) for Debian servers. It includes Nginx and MySQL as well as PHP 7!

GNU/Linuxディストリビューションによっては、パッケージマネージャーでPHP 7が既に利用できる場合があります。また、特定のディストリビューション向けにPHPをアップグレードするためのビデオチュートリアルが用意されている場合もあります。

無料のSEO監査を受ける

無料のSEO監査フォーム

"*" indicates required fields

このフィールドは検証目的のためであり、変更しないでください。
コンテンツ
この記事をお楽しみいただけましたか?
Share it on social media!
無料のSEO監査を受ける

無料のSEO監査フォーム

"*" indicates required fields

このフィールドは検証目的のためであり、変更しないでください。
無料のSEO監査を受ける

無料のSEO監査フォーム

"*" indicates required fields

このフィールドは検証目的のためであり、変更しないでください。
この記事は気に入っていただけましたか?
Share it on social media!

返信を残す

別のブログ投稿もチェックしてください!

すべてのブログ投稿に戻る
© 2024 Bright Vessel. All rights reserved.
下向きシェブロン左矢印