What is the difference between PHP5 and PHP7?

tlhIngan

Member
Registered
Joined
Jul 12, 2016
Messages
49
Points
8
I want to upgrade my PHP 5 to PHP7 but I don't know my website can work with some new functions of PHP or not. What are the features of PHP7 over PHP5? I read that PHP7 can boost the loading speed for your websites. Is that true?
 

LJSHost

Well-known member
Hosting Provider
Registered
Joined
Jul 5, 2016
Messages
1,031
Points
63
You should not have any problems upgrading from 5 - 7, however their is a small chance the upgrade could cause problems if you code is not compliant to version 7 standards.

If you are on cloudlinux you can change PHP version with a couple of clicks.
PHP 7 uses the new PHPNG engine and is reported to be almost twice the speed.
 

Harry P

Well-known member
Registered
Joined
Feb 3, 2015
Messages
447
Points
28
I don't see any differences between PHP5 and PHP7 except php 7 gives your website better speed.
While to run this version, your web system need to be compatible with it or you have to update addons to run good with it.
 

bestcast4u

Member
Registered
Joined
Feb 2, 2017
Messages
54
Points
0
If you update to php 7 you can notice resource usage drop by at least 40%-50% and perfomance increase by as much too
 

WPCycle

Well-known member
Hosting Provider
Registered
Joined
Dec 31, 2016
Messages
123
Points
18
PHP7 is just two steps higher than PHP 5. If someone talks about PHP6...run.

But in seriousness, one thing can can be looked at as a positive or negative with PHP7 are codes breaking. There's a lot of lazy coding or bad codes that exist, and PHP7 has forced designers to fix their codes. A win-win for designers and end-users. Good codes that follow strict practices will work in almost any version of PHP5 and PHP7 without issue.
 

Dr. McKay

Well-known member
Registered
Joined
Nov 26, 2016
Messages
565
Points
28
Dr. McKay
Thanks for sharing this info!

I moved over 50% of my sites to php7 and some custom sites are running on PHP5.6 with caching system
I read that some caching could not install on PHP7, should I move to PHP7 without using any caching as memcahed, acpu?
 

VictorVictories

Well-known member
Registered
Hosting Provider
Joined
Feb 7, 2017
Messages
114
Points
0
Performance was enhanced by ZEND to speed up PHP based applications. Without changing single piece of code, only upgrading to PHP7 gives huge performance. PHP 7 benefits by having up to 2x faster performance when compared to PHP 5.x.
 

fishmonk

Well-known member
Registered
Joined
Jul 21, 2017
Messages
86
Points
8
The major difference between PHP5 and PHP7 would be the performance.Once you migrate to PHP7, you will see a huge increase in the performance.

Php7 is able to boost your application development by using the latest resources.The introduction of an Abstract Syntax Tree allows easier parsing and reduction in errors.

Do note that many fatal and recoverable fatal errors have been converted to exceptions in PHP 7.
 

24x7serverman

Well-known member
Hosting Provider
Registered
Joined
Jul 25, 2017
Messages
651
Points
28
Main differences between PHP5 and PHP7 are as below -

1. In PHP 5 is using Zend Engine II while PHP7 is using PHPNG (that is PHP Next Generation)
2. PHP7 has great speed and optimized memory usage.
3. In PHP7, error exception facility called Engine Exception is present in which you can mark the fatal error as exception.
4. PHP7 supports 64-bit system while PHP5 does not support it.
 

ballyhara

New member
Registered
Joined
Jul 18, 2017
Messages
14
Points
0
One of the differences between them is the speed, PHP7 is faster, needs less servers, the codes run super quickly.
Another plus is that you can use base exceptions, so you can get rid of catchable errors.
Something really cool is that you can run it as always on Linux, but this one is also supported on Windows
You can use anonymous classes, so better execution obviously.
Basically what you will notice is the increase of the speed and the performance, has some new features like the spaceship operator, and the null coalesce operator.
It has some issues with backwards compatibility though, but definitively is not due to its design.
 

Hostingraya

Member
Registered
Joined
Jul 26, 2017
Messages
31
Points
0
The major difference is in performance.The performance was improved by ZEND to speed up PHP based applications. the performance improvement was huge. Without changing single piece of code, just upgrading to PHP7 gives you enormous performance. Removing certain redundant features can also help improving the performance.

Twice The Speed

The most easily recognizable advantage of the new PHPNG engine is the significant performance improvement. The development team of PHPNG refactored the Zend Engine, and remarkably optimized memory usage.

The results? You can see the performance benchmarks provided by the Zend Performance Team below. By using PHP 7 not only your code will be executed faster but you will also need fewer servers to serve the same amount of users.

main-qimg-704ac0efcd15c00e6150fc1731f182a9-c.jpg

main-qimg-4d860e662842170b0546c916aef8fce4-c.jpg
 

fishmonk

Well-known member
Registered
Joined
Jul 21, 2017
Messages
86
Points
8
I will just mention some points which I find interesting on PHP 7 .PHP7 enables you to use anonymous classes, already a well-established practice in other object-oriented languages like C# and Java.
PHP7 is utilising Zend Engine II .This engine enhanced the functionality of the initial engine and adds an extensible object model and a significant performance enhancement to the language.
PHP7 is also adept at facilitating Error Handling
 

Cherin

Member
Registered
Hosting Provider
Joined
Apr 21, 2015
Messages
63
Points
8
Advantages of PHP 7
- Benchmarks for PHP 7 consistently show speeds twice as fast as PHP 5.6 and many times even faster
- Error Handling - if an exception thrown from an error that was fatal in PHP 5 goes uncaught, it will still be a fatal error in PHP 7.
- New Operators
- Easy User-land CSPRNG
 

ryo ionut

New member
Registered
Joined
Jul 31, 2017
Messages
9
Points
0
There are significant differences between PHP5 and PHP7,the main one,as everybody agrees is the performance given by the 2 classes above PHP 7 has. The main focus of PHP 7 is to optimize the structure that represents a variable in PHP—Zend values (zvals). In PHP 7, zvals are not heap allocated and no longer store a refcount. Instead, the refcount is stored by any complex values the zval points to (such as strings, arrays, or objects).
The fact that simple values are not heap allocated in PHP 7 eliminates the need for refcounting, which in and of itself results in a significant performance boost.
 
Older Threads
Replies
56
Views
12,718
Replies
5
Views
3,227
Replies
7
Views
2,300
Newer Threads

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top