The only errors that may occur are due to codes used in events, libraries, and methods that are not compatible with PHP 7.0. These errors must be corrected manually.

1 - Short open tags

The short\_open\_tag directive tells PHP whether the abbreviated form ( ?) of the PHP opening tag is allowed.  
  
Regardless of the php version, you need to check in php.ini if short\_open\_tags is enabled.

Solution 1:  
Change the opening tag of php to (php ?)  
Solution 2:  
Change the short\_open\_tags directive in php.ini:

```
short_open_tags = On
```

2 - New objects cannot be assigned by reference

:   The result of the new statement can no longer be assigned to a variable by reference:

```
php<br style="box-sizing: border-box" /class C {}  
$c =& new C;  
?>
```

The example above will print in PHP 5:  
              Deprecated: Assigning the return value of new by reference is deprecated in /tmp/test.php on line 3  
  
The above example will print in PHP 7:  
              Parse error: syntax error, unexpected 'new' (T\_NEW) in /tmp/test.php on line 3

Solution:  
              Remove reference (&) from assignment:

```
php<br style="box-sizing: border-box" /class C {}  
$c = new C;  
?>
```

3 - PHP 4 Style Constructors

PHP 4 style constructors (methods that have the same name as the class where they are defined) are deprecated, and will be removed in the future. PHP 7 will issue E\_DEPRECATED if a PHP 4 constructor is the only constructor defined in the class. Classes that implement the \_\_construct () method are not affected.

```
php<br style="box-sizing: border-box" /class foo {  
    function foo() {  
        echo 'Eu sou um construtor';  
    }  
}  
?>
```

The above example will print:

```
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; foo has a deprecated constructor in example.php on line 3
```

4 - Static calls to non-static methods

Static calls to methods that have not been declared as static are deprecated, and can be removed in the future.

```
php<br style="box-sizing: border-box" /class foo {  
    function bar() {  
        echo 'Eu não sou estático!';  
    }  
}  
  
foo::bar();  
  
?>
```

The above example will print:

```
Deprecated: Non-static method foo::bar() should not be called statically in - on line 8  
I am not static!
```

For more information:

- [PHP 7.0 new features](http://php.net/manual/en/migration70.new-features.php)  
  - [PHP 7.0 deprecated features](http://php.net/manual/en/migration70.deprecated.php)

Source: [http://php.net](http://php.net/)