php-doc-en/appendices/migration70/deprecated.xml

141 lines
3.5 KiB
XML
Raw Permalink Normal View History

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<sect1 xml:id="migration70.deprecated">
<title>Deprecated features in PHP 7.0.x</title>
<!-- password_hash() salt option, PHP4-style constructors etc -->
<!-- skeleton
<sect2 xml:id="migration70.deprecated.id">
<title>Title</title>
<para>
Content
</para>
</sect2>
-->
<sect2 xml:id="migration70.deprecated.php4-constructors">
<title>PHP 4 style constructors</title>
<para>
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 <constant>E_DEPRECATED</constant> if a PHP 4 constructor is the
only constructor defined within a class. Classes that implement a
<function>__construct</function> method are unaffected.
</para>
<informalexample>
<programlisting role="php">
<![CDATA[
<?php
class foo {
function foo() {
echo 'I am the constructor';
}
}
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
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
]]>
</screen>
</informalexample>
</sect2>
<sect2 xml:id="migration70.deprecated.static-calls">
<title>Static calls to non-static methods</title>
<para>
<link linkend="language.oop5.static">Static</link> calls to methods that
are not declared <command>static</command> are deprecated, and may be
removed in the future.
</para>
<informalexample>
<programlisting role="php">
<![CDATA[
<?php
class foo {
function bar() {
echo 'I am not static!';
}
}
foo::bar();
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
Deprecated: Non-static method foo::bar() should not be called statically in - on line 8
I am not static!
]]>
</screen>
</informalexample>
</sect2>
<sect2 xml:id="migration70.deprecated.pwshash-salt-option">
<title><function>password_hash</function> salt option</title>
<para>
The salt option for the <function>password_hash</function> 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.
</para>
</sect2>
<sect2 xml:id="migration70.deprecated.capture-session-meta">
<title><literal>capture_session_meta</literal> SSL context option</title>
<para>
The <literal>capture_session_meta</literal> SSL context option has been
deprecated. SSL metadata is now available through the
<function>stream_get_meta_data</function> function.
</para>
</sect2>
<sect2 xml:id="migration70.deprecated.ldap">
<title><link linkend="book.ldap">LDAP</link> deprecations</title>
<simpara>
The following function has been deprecated:
</simpara>
<itemizedlist>
<listitem>
<simpara>
<function>ldap_sort</function>
</simpara>
</listitem>
</itemizedlist>
</sect2>
</sect1>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->