array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'es', ), 'this' => array ( 0 => 'migration70.deprecated.php', 1 => 'Deprecated features in PHP 7.0.x', ), 'up' => array ( 0 => 'migration70.php', 1 => 'Migración de PHP 5.6.x a PHP 7.0.x', ), 'prev' => array ( 0 => 'migration70.new-features.php', 1 => 'New features', ), 'next' => array ( 0 => 'migration70.changed-functions.php', 1 => 'Changed functions', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'appendices/migration70/deprecated.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
PHP 4 style constructors (methods that have the same name as the class they
are defined in) are deprecated, and will be removed in the future. PHP 7
will emit E_DEPRECATED
if a PHP 4 constructor is the
only constructor defined within a class. Classes that implement a
__construct() method are unaffected.
<?php
class foo {
function foo() {
echo 'I am the constructor';
}
}
?>
El resultado del ejemplo sería:
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
Static calls to methods that are not declared static are deprecated, and may be removed in the future.
<?php
class foo {
function bar() {
echo 'I am not static!';
}
}
foo::bar();
?>
El resultado del ejemplo sería:
Deprecated: Non-static method foo::bar() should not be called statically in - on line 8 I am not static!
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 available through the
stream_get_meta_data() function.