The PHP 7.0.0 released on 3 December 2015 opening new possibilities to developers who love working with Open Source. Whether you use WordPress, Joomla or Magneto its time to migrate from old version of PHP to new PHP 7.0.0 and tweak your web applications. Whenever you start to adopt new version, first, take strong back up of all your data. The new PHP 7 release is the biggest change brought out after PHP 3 version. Here are 10 Things you must know about PHP 7.
The PHP 7 is a new version in PHP language series for web programming and general purpose programming. The name PHP 7 is rolled out after much debate over PHP 6 and Unicode. The name PHP 7 was decided after a vote. The last stable released version is PHP 5.5.30. The new version is PHP 7.0.0.
The Zend Engine written in C empowers PHP since 1999 with the release of PHP 4. The previous version of PHP uses Zend Engine II. However, the latest release PHP 7 is powered by PHP#NG (Next Generation).
Your web applications shall work at lightning speed. The PHP#NG Engine is fast. Your website shall load nearly two times faster.
The PHP#NG Engine powering PHP 7.0.0 is awesome in dealing with fatal and catchable fatal errors. The new EngineException objects don’t extend the Exception Base Class. This provides for compatibility and results in two different types of exceptions in error handling: traditional and engine exceptions.
The PHP 7.0.0 works well on 64 bit system. Both native 64 bit system and large files will be supported.
The Combined Comparison Operator is the new Spaceship Operator in PHP 7.0.0. The Notation of new operator looks like <=>
If both operators are equal it returns 0, returns 1 if the left is greater and -1 if right is greater. It’s also called Three Way Comparison Operator. Programming languages like Perl and Ruby already uses this operator.
The Null Coalescing Operator is denoted with two question marks (??). This operator can be used when you need to find if a thing exists and returns a default value or not.
With the help of Return Type Declarations you can improve the quality of code in new PHP 7.0.0.
In PHP 7, you can use anonymous classes. This is well known practice in other programming languages like Java and C#.
In the new version PHP 7 you can import many classes from the same namespace. Thus you can save lots of time on coding.
In new PHP 7.0.0 developers did away with functionalities those were found controversial in previous versions.
A list is available here (Source: php.net).
1. dl on fpm-fcgi (since PHP 5.3)
2. set_magic_quotes_runtime and magic_quotes_runtime (since PHP 5.4)
3. set_socket_blocking (since PHP 5.4; use stream_set_blocking instead)
4. mcrypt_generic_end (since PHP 5.4; use mcrypt_generic_deinit instead)
5. mcrypt_ecb, mcrypt_cbc, mcrypt_cfb and mcrypt_ofb (since PHP 5.5, but documented as deprecated earlier; use mcrypt_encrypt and mcrypt_decrypt instead)
6. datefmt_set_timezone_id and IntlDateFormatter::setTimeZoneID (since PHP 5.5; use datefmt_set_timezone or IntlDateFormatter::setTimeZone instead)
For more list of deprecated function in php 7 click here