Backend Development

Php 5.6 or 7

Submitted by ASMS, , Thread ID: 44076

Thread Closed

RE: Php 5.6 or 7

#11
5.6 is perfect if you want to use older software, for anything 2016+ use php 7.x

It's that simple! :D

RE: Php 5.6 or 7

#12
I'd definitely say PHP 7 for any new projects you're going to work on, 5.6 is going to reach EOL quicker.

RE: Php 5.6 or 7

#13
Its depend on the apps you using its. For stable use 5.6. For new apps use 7.0 above. Good luck.

RE: Php 5.6 or 7

#14
even if there was more cms apps with 5.6, always keep your stuff update to date because it isn't worth it to stay back just because of the apps

RE: Php 5.6 or 7

#15
guys, all my apps work with 5.6. Is there much work if I decide to rewrite them for 7? I didn't check the difference 5.6 vs 7 just yet. Is there any online service to quickly convert php from 5.x to 7? Thanks

RE: Php 5.6 or 7

#16
14-08-2017, 04:14 PM
ASMS Wrote:
which better for current famous scripts and plugins
likes wordpress , whmcs , joomla , presetashop
it that better to upgrade my php version to 7 or not ? what is the differences ?

PHP 7 is good for fast and good performance compare to 5.6

RE: Php 5.6 or 7

#17
I would use php 7 because its much faster than php 5.6 but it depends on your cms which u want to use.

RE: Php 5.6 or 7

#18
Hello,

I would definitely go with PHP 7 as there is a lot security issues fixed in it and also the performance is unreal compared to older version. Again it depends if your CMS supports PHP 7 but nearly all do as you can upgrade to latest version.

RE: Php 5.6 or 7

This post was last modified: 30-10-2017, 07:07 AM by abelas
#19
I have found this somewhere(Vizteck) I think might be usefulll.. thank you

HP 7 is a revolution all along the way to empower web. It is the time to get up and learn PHP 7. PHP 7 has covered all the loopholes of the earlier version release. The substantial shift to this newest updates makes it really awesome. It is the great step towards the performance improvements, reduced memory consumption, and other most prominent features enhancement.

The features are enhanced and new things in it makes it blazing. The most prominent one is the Zend Engine 3.0 that doubles the performance in terms of processing as well as the memory consumption than in previous versions.

I am going to discuss in detail what makes PHP7 awesome.

Better Performance

The certified PHP distribution stack with new developing, debugging, monitoring and deploying tools gives you an efficient path to PHP 7. With the Zend Engine 3.0 ( the open-source execution engine written in C, that interprets the code), you can have 50% better memory consumption.

Quality Assurance Practices

The testing practices you can do in PHP 7 are more than awesome. The perfect testing environment will ensure you best quality assurance practices so that you will deliver the most secure and tested product to your clients.

This is only because of the Zend Server that will come up with the variety of testing tools, latest code tracing, Z-Ray Zends productivity and debugging tools.

New Programming practices

The V7 PHP is tremendous in programming practices and performance. The overall LAMP stack constitute the PHP as a prominent part of it.

The updated programming practices are:

If you want to import many classes from the same namespace, then ?Group Use Declaration will facilitate you. It results in more easier, cleaner and also saves time while code. Like,

// New group use syntax in PHP7:

use FooLibrary\Bar\Baz\{ ClassA, ClassB, ClassC, ClassD as Fizbo};
// Compared to current use syntax in Earlier Versions:

use FooLibrary\Bar\Baz\ClassA;
use FooLibrary\Bar\Baz\ClassB;
use FooLibrary\Bar\Baz\ClassC;
use FooLibrary\Bar\Baz\ClassD as Fizbo;

The deprecated functionality has been eliminated. All the older functions are omitted that causes the non responsive and illegal memory consumption. The functions that are obsolete now may be the unsupported Server APIs and extensions.

For instance, the following extensions are now considered as deprecated.

ext/ereg (since PHP 5.3; use ext/pcre instead) ,
ext/mysql (since PHP 5.5; use ext/mysqli or ext/pdo_mysql instead).

They are not workable or will be cutted from the PHP 7.x

Likewise many functions, ini options, language features,the unbundled extensions, assignment of new expressions by references and many other functions that are mentioned here.

PHP 7 lets you use Anonymous classes. This approach was adopted by C# and Java. The main benefit of using the anonymous class is , you can use the object having the same functionality with the anonymous class . The name is missing for that type of class. So, in result, well have well coded, and speedy object initiation via using the Anonymous classes.
You can return an instance and anything you need now.
The new operators are introduced that can work on it like:

$a<$b is equivalent to

($a$b)===-1)

So, we have the concept of combined comparison operators , which will give you more detailed and simpler approach to code now. Moreover, the NULL Coalescing Operator is meant to use in the situations where you need to add the conditional operators, or any conditional statements and want the result like:

$model= Model::get($id)??$define_model;

The ?? operator will semantically return the value of the devised condition.

As another example, you can say that by using the NULL Coalescing Operators, it is written as:

$username=$GET[user] ?? nobody;

But in the earlier version that was not introduced and this statement can be written as

$username = isset($_GET[user]) ? $_GET[user] : nobody;

Better Error/Exception Handling

The error handling is the most important phase during coding. PHP 7 provides you the most extraordinary practices for exception handling.The exception may be caught or uncaught and your error is your uncatched exception. The latest version of PHP gives you the unbelievable support for Uncaught Exception.

The traditional method for reporting error has been changed now. The practices in PHP 7 finds you new way to throw the exception by implementing Throwable (not in PHP 5.x, it is only valid in latest version PHP 7) to that relevant Error class. This concept is put forward to get rid of traditional and engine exceptions in PHP 5 or previous versions.

The new Engine Exceptions are introduced to replace the relevant type of errors with the exceptions. Like, for PHP 5.x or PHP 7 when you want to catch both exceptions and errors. You have to add a catch block, to change after catching Throwable first.

try
{
// Code that may throw an Exception or Error.
}
catch (Throwable $t)
{
// Executed only in PHP 7, will not match in PHP 5
}
catch (Exception $e)
{
// Executed only in PHP 5, will not be reached in PHP 7
}

64 bit Support

Being a member of LAMP stack, default PHP is Linux based. The later versions has support of it on only Linux. If you are working in Windows environment then many x64 bit variables are not accessible in PHP 5.x or previous versions. You cant access all the fruits of PHP while working on Windows environment.

The PHP 7 has revolutionized this critical downside of it. Now, the advent of PHP 7 has cracked the consistent 64-bit support which ensures both native x86 or x64 bit integers or large file support.

RE: Php 5.6 or 7

#20
php7 e muito mais seguro so uso php 7
Verifique em seu host e mude rapidamente!

Users browsing this thread: 2 Guest(s)