Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions reference/simplexml/simplexmlelement.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 14767af0f05dffa6fdb9b49e1a1f4e9ca7022a60 Maintainer: mch Status: ready -->
<!-- EN-Revision: 418ec505128707215c5c99ad4a66a88bfd84a0ff Maintainer: mch Status: ready -->
<!-- Reviewed: no -->
<reference xml:id="class.simplexmlelement" 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>Класс SimpleXMLElement</title>
Expand Down Expand Up @@ -39,12 +39,8 @@
</oointerface>

<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.simplexmlelement')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[@role='SimpleXMLElement'])">
<xi:fallback/>
</xi:include>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.simplexmlelement')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[@role='SimpleXMLElement'])">
<xi:fallback/>
</xi:include>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.simplexmlelement')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[@role='SimpleXMLElement'])"/>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.simplexmlelement')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[@role='SimpleXMLElement'])"/>
</classsynopsis>
<!-- }}} -->

Expand All @@ -61,6 +57,18 @@
</row>
</thead>
<tbody>
<row>
<entry>8.4.0</entry>
<entry>
Методы получения данных наподобие
<methodname>SimpleXMLElement::asXML</methodname>
и <methodname>SimpleXMLElement::getName</methodname>
или приведение объекта <classname>SimpleXMLElement</classname> к типу
&string; больше не перематывают итератор неявно.
Итератор перематывают явно вызовом метода
<methodname>SimpleXMLElement::rewind</methodname>.
</entry>
</row>
<row>
<entry>8.0.0</entry>
<entry>
Expand Down
25 changes: 18 additions & 7 deletions reference/simplexml/simplexmlelement/rewind.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: dcb657b7e9e4f7622ce3394ae1fa3c14538721e1 Maintainer: sergey Status: ready -->
<!-- EN-Revision: 418ec505128707215c5c99ad4a66a88bfd84a0ff Maintainer: sergey Status: ready -->
<!-- Reviewed: no -->
<refentry xml:id="simplexmlelement.rewind" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SimpleXMLElement::rewind</refname>
<refpurpose>Перемотка к первому элементу</refpurpose>
<refpurpose>Перематывает итератор к первому элементу</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
Expand All @@ -15,14 +15,25 @@

<warning>
<simpara>
До версии PHP 8.0 метод <methodname>SimpleXMLElement::rewind</methodname>
был объявлен только для дочернего класса <classname>SimpleXMLIterator</classname>.
До PHP 8.0 метод <methodname>SimpleXMLElement::rewind</methodname>
объявлялся только для подкласса <classname>SimpleXMLIterator</classname>.
</simpara>
</warning>

<para>
Метод перематывает <classname>SimpleXMLElement</classname> к первому элементу.
Метод перематывает объект <classname>SimpleXMLElement</classname> к первому элементу.
</para>

<note>
<simpara>
Начиная с PHP 8.4.0 вызов методов получения данных наподобие
<methodname>SimpleXMLElement::asXML</methodname>
и <methodname>SimpleXMLElement::getName</methodname>
или приведение объекта <classname>SimpleXMLElement</classname> к типу
&string; больше не перематывают итератор неявно. Итератор
перематывают явно вызовом этого метода.
</simpara>
</note>
</refsect1>

<refsect1 role="parameters">
Expand All @@ -41,15 +52,15 @@
&reftitle.examples;
<para>
<example>
<title>Перемотка к первому элементу</title>
<title>Пример перемотки итератора к первому элементу</title>
<programlisting role="php">
<![CDATA[
<?php

$xmlElement = new SimpleXMLElement('<books><book>PHP Basics</book><book>XML Basics</book></books>');
$xmlElement->rewind();

var_dump($xmlElement->current());
?>
]]>
</programlisting>
&example.outputs;
Expand Down
Loading