---
title: "PHP5 vs PHP7"  
description: "PHP5 vs PHP7"  
author: "Anonymous User"  
published: 2018-07-13  
updated: 2018-07-13  
canonical: https://www.mindstick.com/forum/34612/php5-vs-php7  
category: "php"  
tags: ["web development", "php", "phpmyadmin"]  
reading_time: 2 minutes  

---

# PHP5 vs PHP7

[difference](https://www.mindstick.com/articles/157114/good-news-or-bad-news-and-the-difference-is) between [PHP](https://www.mindstick.com/articles/12149/php-constant-and-php-variables) 5 vs PHP 7 ?

## Replies

### Reply by Prakash nidhi Verma

PHP 5 vs PHP 7:

PHP is a server side scripting language used for web designing and development. PHP has become an industry standard before ASP.Net and others like Ruby, Java. The new PHP version released the latest version of PHP is PHP 7. which is claiming it to be twice as fast as its predecessor PHP 5.

- Advantages:

- Performance:

- Return Type:

```
public function area (float $r) : float     {        return 3.14*$r*$r;
    }
```

-Spaceship Operator:\

```
 function sort ($a,$b)
    {
        if ($a>$b)
            return 1;
        else if ( $a ==$b)
            return 0;
       else
            return -1;
    }
```

In PHP 7:

```
    function sort ($a,$b)
    {
       return $a < = > $b;
    }
```

- Null Coalesce Operator:

```
 if (isset ($_GET [‘name’]))
   {
        $name = $_GET [‘name’];
   }
   else
        $name = null;
```

In PHP 7:

```
$name = $_GET [‘name’]?? Null;
```


---

Original Source: https://www.mindstick.com/forum/34612/php5-vs-php7

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
