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
|
<?xml version="1.0" encoding="utf-8"?>
<sect1 xml:id="migration82.deprecated">
<title>Deprecated Features</title>
<sect2 xml:id="migration82.deprecated.core">
<title>PHP Core</title>
<sect3 xml:id="migration82.deprecated.core.dynamic-properties">
<title>Usage of dynamic properties</title>
<para>
The creation of dynamic properties is deprecated, unless the class opts in by
using the <code>#[\AllowDynamicProperties]</code> attribute.
<classname>stdClass</classname> allows dynamic properties.
Usage of the <link linkend="object.get">__get()</link>/<link linkend="object.set">__set()</link> magic methods is not affected by this change.
A dynamic properties deprecation warning can be addressed by:
<simplelist>
<member>Declaring the property (preferred).</member>
<member>
Adding the <code>#[\AllowDynamicProperties]</code> attribute to the class
(which also applies to all child classes).
</member>
<member>
Using a <classname>WeakMap</classname> if additional data needs to be
associated with an object which one does not own.
</member>
</simplelist>
</para>
</sect3>
<sect3 xml:id="migration82.deprecated.core.relative-callables">
<title>Relative callables</title>
<para>
Callables that are not accepted by the <code>$callable()</code> syntax
(but are accepted by <function>call_user_func</function>) are deprecated.
In particular:
<simplelist>
<member><code>"self::method"</code></member>
<member><code>"parent::method"</code></member>
<member><code>"static::method"</code></member>
<member><code>["self", "method"]</code></member>
<member><code>["parent", "method"]</code></member>
<member><code>["static", "method"]</code></member>
<member><code>["Foo", "Bar::method"]</code></member>
<member><code>[new Foo, "Bar::method"]</code></member>
</simplelist>
This does not affect normal method callables such as
<code>"A::method"</code> or <code>["A", "method"]</code>.
</para>
<!-- RFC: https://wiki.php.net/rfc/deprecate_partially_supported_callables -->
<!-- RFC: https://wiki.php.net/rfc/partially-supported-callables-expand-deprecation-notices -->
</sect3>
<sect3 xml:id="migration82.deprecated.core.dollar-brace-interpolation">
<title><code>"${var}"</code> and <code>"${expr}"</code> style interpolation</title>
<para>
The <code>"${var}"</code> and <code>"${expr}"</code> style of string
interpolation is deprecated.
Use <code>"$var"/"{$var}"</code> and <code>"{${expr}}"</code>, respectively.
<!-- RFC: https://wiki.php.net/rfc/deprecate_dollar_brace_string_interpolation -->
</para>
</sect3>
</sect2>
<sect2 xml:id="migration82.deprecated.mbstring">
<title>MBString</title>
<para>
Usage of the <literal>QPrint</literal>, <literal>Base64</literal>,
<literal>Uuencode</literal>, and <literal>HTML-ENTITIES</literal>
'text encodings' is deprecated for all MBString functions.
Unlike all the other text encodings supported by MBString,
these do not encode a sequence of Unicode codepoints, but rather a sequence of raw bytes.
It is not clear what the correct return values for most MBString functions
should be when one of these non-encodings is specified.
Moreover, PHP has separate, built-in implementations of all of them;
for example, UUencoded data can be handled using
<function>convert_uuencode</function>/<function>convert_uudecode</function>.
</para>
</sect2>
<sect2 xml:id="migration82.deprecated.spl">
<title>SPL</title>
<para>
The internal <methodname>SplFileInfo::_bad_state_ex</methodname> method
has been deprecated.
</para>
</sect2>
<sect2 xml:id="migration82.deprecated.standard">
<title>Standard</title>
<para>
<function>utf8_encode</function> and <function>utf8_decode</function>
have been deprecated.
</para>
</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
-->
|