-
Notifications
You must be signed in to change notification settings - Fork 813
PHP 8.4: Document SplObjectStorage::seek() #4048
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7df91dc
PHP 8.4: Document SplObjectStorage::seek()
Girgias 3549763
Add info in versions.xml
Girgias 42b2034
Document SplObjectStorage::seek()
nielsdos 5a9c684
Change para to simpara in errors of SeekableIterator::seek()
nielsdos 465c1de
Document ArrayIterator::seek()
nielsdos 62259b1
fix
nielsdos 38bfa49
Fix some markup issues
Girgias File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<refentry xml:id="splobjectstorage.seek" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
<refnamediv> | ||
<refname>SplObjectStorage::seek</refname> | ||
<refpurpose>Seeks iterator to a position</refpurpose> | ||
</refnamediv> | ||
|
||
<refsect1 role="description"> | ||
&reftitle.description; | ||
<methodsynopsis role="SplObjectStorage"> | ||
<modifier>public</modifier> <type>void</type><methodname>SplObjectStorage::seek</methodname> | ||
<methodparam><type>int</type><parameter>offset</parameter></methodparam> | ||
</methodsynopsis> | ||
|
||
<simpara> | ||
Seeks to a given position in the iterator. | ||
</simpara> | ||
</refsect1> | ||
|
||
<refsect1 role="parameters"> | ||
&reftitle.parameters; | ||
<para> | ||
<variablelist> | ||
<varlistentry> | ||
<term><parameter>offset</parameter></term> | ||
<listitem> | ||
<simpara> | ||
The position to seek to. | ||
</simpara> | ||
</listitem> | ||
</varlistentry> | ||
</variablelist> | ||
</para> | ||
</refsect1> | ||
|
||
<refsect1 role="returnvalues"> | ||
&reftitle.returnvalues; | ||
<simpara> | ||
&return.void; | ||
</simpara> | ||
</refsect1> | ||
|
||
<refsect1 role="errors"> | ||
&reftitle.errors; | ||
<simpara> | ||
Throws an <classname>OutOfBoundsException</classname> | ||
if the <parameter>offset</parameter> is not seekable. | ||
</simpara> | ||
</refsect1> | ||
|
||
<refsect1 role="examples"> | ||
&reftitle.examples; | ||
<example xml:id="splobjectstorage.seek.example.basic"> | ||
<title><methodname>SplObjectStorage::seek</methodname> example</title> | ||
<simpara> | ||
Seeks to item position 2 in the iterator. | ||
</simpara> | ||
<programlisting role="php"> | ||
<![CDATA[ | ||
<?php | ||
class Test { | ||
public function __construct(public string $marker) {} | ||
} | ||
|
||
$a = new Test("a"); | ||
$b = new Test("b"); | ||
$c = new Test("c"); | ||
|
||
$storage = new SplObjectStorage(); | ||
$storage[$a] = "first"; | ||
$storage[$b] = "second"; | ||
$storage[$c] = "third"; | ||
|
||
$storage->seek(2); | ||
var_dump($storage->key()); | ||
var_dump($storage->current()); | ||
?> | ||
]]> | ||
</programlisting> | ||
&example.outputs; | ||
<screen> | ||
<![CDATA[ | ||
int(2) | ||
object(Test)#3 (1) { | ||
["marker"]=> | ||
string(1) "c" | ||
} | ||
]]> | ||
</screen> | ||
</example> | ||
</refsect1> | ||
|
||
<refsect1 role="seealso"> | ||
&reftitle.seealso; | ||
<simplelist> | ||
<member><classname>SeekableIterator</classname></member> | ||
</simplelist> | ||
</refsect1> | ||
|
||
</refentry> | ||
<!-- 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 | ||
--> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.