1
0
mirror of https://github.com/php/doc-ru.git synced 2026-04-27 01:08:05 +02:00
Files
archived-doc-ru/language/predefined/attributes/allowdynamicproperties.xml
T
2024-06-14 17:02:33 +01:00

99 lines
2.9 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: f94d903985119d3ac00f4528551df947f57b667f Maintainer: sergey Status: ready -->
<!-- Reviewed: no -->
<reference xml:id="class.allowdynamicproperties" role="class" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
<title>Класс AllowDynamicProperties</title>
<titleabbrev>AllowDynamicProperties</titleabbrev>
<partintro>
<section xml:id="allowdynamicproperties.intro">
&reftitle.intro;
<para>
Атрибут маркирует классы, в которых разрешается объявлять
<link linkend="language.oop5.properties.dynamic-properties">динамические свойства</link>.
</para>
</section>
<section xml:id="allowdynamicproperties.synopsis">
&reftitle.classsynopsis;
<classsynopsis class="class">
<ooclass>
<modifier>final</modifier>
<classname>AllowDynamicProperties</classname>
</ooclass>
<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.allowdynamicproperties')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[@role='AllowDynamicProperties'])">
<xi:fallback/>
</xi:include>
</classsynopsis>
</section>
<section>
&reftitle.examples;
<para>
Динамические свойства устарели с PHP 8.2.0, поэтому объявление динамического свойства
без маркировки класса этим атрибутом приведёт к появлению уведомления об устаревании.
</para>
<informalexample>
<programlisting role="php">
<![CDATA[
<?php
class DefaultBehaviour {}
#[\AllowDynamicProperties]
class ClassAllowsDynamicProperties {}
$o1 = new DefaultBehaviour();
$o2 = new ClassAllowsDynamicProperties();
$o1->nonExistingProp = true;
$o2->nonExistingProp = true;
?>
]]>
</programlisting>
&example.outputs.82;
<screen>
<![CDATA[
Deprecated: Creation of dynamic property DefaultBehaviour::$nonExistingProp is deprecated in file on line 10
]]>
</screen>
</informalexample>
</section>
<section xml:id="allowdynamicproperties.seealso">
&reftitle.seealso;
<para><link linkend="language.attributes">Введение в атрибуты</link></para>
</section>
</partintro>
&language.predefined.allowdynamicproperties.construct;
</reference>
<!-- 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
-->