PHP 7 Deprecated Features

Following highlights are deprecated and might be removed from future arrivals of PHP.

PHP 4 style constructors (methods that have a similar name as the class they are characterized in) are deplored, and will be evacuated later on. PHP 7 will discharge E_DEPRECATED if a PHP 4 constructor is the main constructor characterized inside a class. Classes that execute a __construct() strategy are unaffected.

It produces the following browser output −

Deprecated: Methods with the same name as their class will not be constructors 
in a future version of PHP; A has a deprecated constructor in...

Static calls to non-static methods

Static calls to methods that are not declared static are deprecated, and may be removed in the future.


   class A {
      function b() {
         print('Non-static call');

It produces the following browser output −

Deprecated: Non-static method A::b() should not be called statically in...
Non-static call

password_hash() salt option

The salt option for the password_hash() function has been deprecated to prevent developers from generating their own (usually insecure) salts. The function itself generates a cryptographically secure salt when no salt is provided by the developer - therefore custom salt generation should not be needed.

capture_session_meta SSL context option

The capture_session_meta SSL context option has been deprecated. SSL metadata is now used through the stream_get_meta_data() function.