Home » , » PHP 7 All Set to Launch its First Release Candidate (RC) in Mid-June 2017

PHP 7 All Set to Launch its First Release Candidate (RC) in Mid-June 2017

jaki watson | 23:21 | 0 comments
PHP 7


Finally, PHP 5.0.0 is well-known as PHP 7 as the company has been agreed with the name or version of PHP to be obtainable for users, who most likely to appear in mid-june 2017.

No matter whether you like it or not – PHP 7 is a thing:

Does this really matter to you? Constant augmenting numbers of webhosts are moving towards newer versions of 5.x.

Are there any opportunities that the new version bring huge backwards compatibility breaks and make things slower?

Today, there are lots of people, who have answered these queries saying “it depends”, to know “WHY” keep reading...

When it comes the new version, it mainly focused on cleaning up the language edge cases. However, the performance and incompatibility fixes were brought to the limelight.

Let's have a deep look in the details:

Inconsistency Fixes -

Regrettably, the haystack/needle problems have not been fixed. But the two essential RFCs have been passed, which will bring some required internal and userland consistence.

The addition, that is mainly visible, is of an Abstract Synxtax Tree (AST) – an intermediate representation of the code while compilation. It will also help you in cleaning-up some edge case inconsistencies and the make way for some amazing tooling.

However, Uniform Variable Syntax (UVS) is the second addition that is mainly designed to resolve frequent inconsistencies as to how expressions are evaluated. For example, the ability to call closures assigned to properties using (($object->closureProperty)(), and is able to chain static calls, like so:

the ability to call closures assigned to properties using ($object->closureProperty)(), and is able to chain static calls, like so:








At the time of using variable-variables/properties semantics are changing big time. In an setting, earlier version of PHP, the property of whose name is in the name key of the $properties array. It would make use of the name key to the property whose name resides in $properties with UVS coming into picture.











Variable-properties are very least uncommon and use of variable-variables once in a blue moon. A user can easily work across this with the help of curly braces to make sure the same behavior in PHP 5.6 and 7.

Performance -

For upgrading to PHP 7, performance can be tagged to be the major reason, and these are considered such changes that are mainly introduced as phpng.

Improved performance makes sure you quick adoption especially from smaller hosts, who would normally not do so; however with this new phpng – it is empowered to host boosted count of customers on the same hardware.

Today's scenario that based on whose benchmark you are selecting, the performance of PHP7 is at par with Facebooks HHVM that mainly featured just in time compiler, which compiles PHP code.

Backwards Incompatible Changes -

Slowly, the language is moving forward, making it quite difficult task for internal developers to put in extra efforts in order to make break Backwards Compatibility (BC) possible – most of the times.

Similarly, BC breaks introduced with Uniform Variable Syntax, various of them are minor, comprising catchable fatal errors while trying to call a method on a non-object:











It is also to note that ASP and script tags are removed that means one can no longer use <% and <%=, or (and their respective close tags, %>, and ).

However, there are some of the more changes that need to be discovered in the removal of all rejected functionality, comprising removal of the POSIX compatible regular expressions extension, ext/ereg (deprecated in 5.3) and the old ext/mysql extension.

The minor BC breaking change is to disallow multiple default cases in a switch. Moving to PHP 7 – following are allowed:












The result in PHP 7 will be:

Fatal error: Switch statements may only contain one default clause

New Features – 

As the company said that it puts its huge efforts to deal with effects of backwards incompatibility while they also appreciate performance. But the company is also waiting for new and advanced features. It is due as everyone wanted to agree that the new features are what makes every single release really exciting. 

Scalar Type Hints & Return Types

Scalar Type Hints and Return Types are considered as the most controversial change or the feature, which has been added to PHP 7. Almost the feature was passed followed with an incident where the author left PHP development, and a lot of RFCs were competing for implementations, which finally ended with an approval of the real RFC.

Here’s you can see how it may look like:
















The all new PHP 7 is also supporting Return Type Hints that are supporting all the same types as arguments. Moreoveor, tt is also following the same syntax as hack, affix the argument parenthesis with a colon followed by the type:






Here: the bool shows that the function will return a boolean. All the rules that are applied to type-hints are relevant to returned type hints for strict mode also. 

Stay tuned for more information on PHP 7 and its solutions as we will get back to you as we get to know something new about it!

More Information Regrading PHP Development portfolio Visit here.

Source: Tech.pro
Share this article :

0 comments:

Post a Comment

 
Design by: