1
0
mirror of https://github.com/php/doc-en.git synced 2026-03-29 19:22:10 +02:00
Files
archived-doc-en/reference/dir/functions/readdir.xml
Gina Peter Banyard 5c7e9e1351 Rework documentation for dir functions (#4989)
Include 8.5 deprecation for passing null to use the last opened directory.
2025-11-27 19:40:35 +00:00

116 lines
3.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<refentry xml:id="function.readdir" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>readdir</refname>
<refpurpose>Read entry from directory handle</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type class="union"><type>string</type><type>false</type></type><methodname>readdir</methodname>
<methodparam choice="opt"><type class="union"><type>resource</type><type>null</type></type><parameter>dir_handle</parameter><initializer>&null;</initializer></methodparam>
</methodsynopsis>
<simpara>
Returns the name of the next entry in the directory.
The entries are returned in the order in which they are stored by
the filesystem.
</simpara>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>dir_handle</parameter></term>
<listitem>
<simpara>
A directory handle <type>resource</type> previously opened
with <function>opendir</function>.
If <parameter>dir_handle</parameter> is &null; the last handle opened
using <function>opendir</function> will be used.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<simpara>
Returns the entry name on success,&return.falseforfailure;.
</simpara>
&return.falseproblem;
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>8.5.0</entry>
<entry>
Using &null; for <parameter>dir_handle</parameter> is now deprecated.
Instead, the last opened directory handle should be explicitly provided.
</entry>
</row>
<row>
<entry>8.0.0</entry>
<entry>
<parameter>dir_handle</parameter> is now nullable.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<simpara>
For a complete example refer to the <function>opendir</function>
documentation.
</simpara>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member><function>opendir</function></member>
<member><function>rewinddir</function></member>
<member><function>closedir</function></member>
<member><function>dir</function></member>
<member><function>is_dir</function></member>
<member><function>glob</function></member>
<member><function>scandir</function></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
-->