1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
|
<?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
-->
|