[DOC-CVS] [doc-en] master: Fix Generator::rewind() docs to match actual behavior (#5031)
[email protected] (Alexander Krause via GitHub)
| Newsgroups | php.doc.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: Alexander Krause (Krause-a)
Committer: GitHub (web-flow)
Pusher: Girgias
Date: 2026-01-11T20:26:58Z
Commit: https://github.com/php/doc-en/commit/5e6944e79f2b19783627d76bd7fd1411feb23c65
Raw diff: https://github.com/php/doc-en/commit/5e6944e79f2b19783627d76bd7fd1411feb23c65.diff
Fix Generator::rewind() docs to match actual behavior (#5031)
Clarify rewind() semantics to prevent misunderstandings about
generator-specific behavior.
Changed paths:
M language/predefined/generator/rewind.xml
Diff:
diff --git a/language/predefined/generator/rewind.xml b/language/predefined/generator/rewind.xml
index 3e028cd414f9..d3fd988b8e6c 100644
--- a/language/predefined/generator/rewind.xml
+++ b/language/predefined/generator/rewind.xml
@@ -3,7 +3,7 @@
<refentry xml:id="generator.rewind" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Generator::rewind</refname>
- <refpurpose>Rewind the generator to the first yield</refpurpose>
+ <refpurpose>Execute the generator up to and including the first yield</refpurpose>
</refnamediv>
<refsect1 role="description">
@@ -13,11 +13,11 @@
<void/>
</methodsynopsis>
<para>
- The method rewinds the generator back to the point before the first &yield;.
- If the generator is not at a first &yield; expression when this method is called,
- it will first be let to advance to the first &yield; expression before rewinding.
- If the generator has already at the point of beginning of the second &yield;,
- this will throw an <classname>Exception</classname>.
+ Executes the generator up to and including the <emphasis>first</emphasis> &yield;.
+ If the generator is already at the <emphasis>first</emphasis> &yield;,
+ no action will be taken.
+ If the generator has ever advanced beyond a &yield; expression,
+ this method will throw an <classname>Exception</classname>.
</para>
<note>
<para>