reference/dir/functions/scandir.xml
3f63f2b26300dd0c15d5635b8053e67448076146
...
...
@@ -9,10 +9,10 @@
9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
-
<type>array</type><methodname>scandir</methodname>
12
+
<type class="union"><type>array</type><type>false</type></type><methodname>scandir</methodname>
13
13
<methodparam><type>string</type><parameter>directory</parameter></methodparam>
14
-
<methodparam choice="opt"><type>int</type><parameter>sorting_order</parameter><initializer>SCANDIR_SORT_ASCENDING</initializer></methodparam>
15
-
<methodparam choice="opt"><type>resource</type><parameter>context</parameter></methodparam>
14
+
<methodparam choice="opt"><type>int</type><parameter>sorting_order</parameter><initializer><constant>SCANDIR_SORT_ASCENDING</constant></initializer></methodparam>
15
+
<methodparam choice="opt"><type class="union"><type>resource</type><type>null</type></type><parameter>context</parameter><initializer>&null;</initializer></methodparam>
16
16
</methodsynopsis>
17
17
<para>
18
18
Returns an <type>array</type> of files and directories from the
...
...
@@ -71,32 +71,27 @@
71
71

72
72
<refsect1 role="changelog">
73
73
&reftitle.changelog;
74
-
<para>
75
-
<informaltable>
76
-
<tgroup cols="2">
77
-
<thead>
78
-
<row>
79
-
<entry>&Version;</entry>
80
-
<entry>&Description;</entry>
81
-
</row>
82
-
</thead>
83
-
<tbody>
84
-
<row>
85
-
<entry>5.4.0</entry>
86
-
<entry>
87
-
<parameter>sorting_order</parameter> <link linkend="dir.constants">constants</link>
88
-
were added. Any nonzero value caused descending order in previous versions. So
89
-
for all PHP versions, use <literal>0</literal> for ascending order, and <literal>1</literal>
90
-
for descending order. An option for <constant>SCANDIR_SORT_NONE</constant> behavior did not
91
-
exist prior to PHP 5.4.0.
92
-
</entry>
93
-
</row>
94
-
</tbody>
95
-
</tgroup>
96
-
</informaltable>
97
-
</para>
74
+
<informaltable>
75
+
<tgroup cols="2">
76
+
<thead>
77
+
<row>
78
+
<entry>&Version;</entry>
79
+
<entry>&Description;</entry>
80
+
</row>
81
+
</thead>
82
+
<tbody>
83
+
<row>
84
+
<entry>8.0.0</entry>
85
+
<entry>
86
+
<parameter>context</parameter> is now nullable.
87
+
</entry>
88
+
</row>
89
+
</tbody>
90
+
</tgroup>
91
+
</informaltable>
98
92
</refsect1>
99
93

94
+

100
95
<refsect1 role="examples">
101
96
&reftitle.examples;
102
97
<para>
...
...
@@ -107,7 +102,7 @@
107
102
<?php
108
103
$dir = '/tmp';
109
104
$files1 = scandir($dir);
110
-
$files2 = scandir($dir, 1);
105
+
$files2 = scandir($dir, SCANDIR_SORT_DESCENDING);
111
106

112
107
print_r($files1);
113
108
print_r($files2);
...
...
@@ -157,7 +152,6 @@ Array
157
152
</para>
158
153
</refsect1>
159
154
</refentry>
160
-

161
155
<!-- Keep this comment at the end of the file
162
156
Local variables:
163
157
mode: sgml
164
158