reference/filesystem/functions/dirname.xml
21cd3a942724400765125b657d24f8c8c4d623e9
21cd3a942724400765125b657d24f8c8c4d623e9
...
...
@@ -35,7 +35,7 @@
35
35
</para>
36
36
<para>
37
37
On other systems, <function>dirname</function> assumes <parameter>path</parameter>
38
-
to be encoded in an ASCII compatible encoding. Otherwise the behavior of the
38
+
to be encoded in an ASCII compatible encoding. Otherwise, the behavior of
39
39
the function is undefined.
40
40
</para>
41
41
</caution>
...
...
@@ -82,30 +82,25 @@
82
82
<parameter>path</parameter> with any trailing
83
83
<literal>/component</literal> removed.
84
84
</para>
85
-
</refsect1>
86
85
87
-
<refsect1 role="changelog">
88
-
&reftitle.changelog;
89
-
<para>
90
-
<informaltable>
91
-
<tgroup cols="2">
92
-
<thead>
93
-
<row>
94
-
<entry>&Version;</entry>
95
-
<entry>&Description;</entry>
96
-
</row>
97
-
</thead>
98
-
<tbody>
99
-
<row>
100
-
<entry>7.0.0</entry>
101
-
<entry>
102
-
Added the optional <parameter>levels</parameter> parameter.
103
-
</entry>
104
-
</row>
105
-
</tbody>
106
-
</tgroup>
107
-
</informaltable>
108
-
</para>
86
+
<caution>
87
+
<para>
88
+
Be careful when using this function in a loop that can reach the
89
+
top-level directory as this can result in an infinite loop.
90
+
<informalexample>
91
+
<programlisting role="php">
92
+
<![CDATA[
93
+
<?php
94
+
dirname('.'); // Will return '.'.
95
+
dirname('/'); // Will return `\` on Windows and '/' on *nix systems.
96
+
dirname('\\'); // Will return `\` on Windows and '.' on *nix systems.
97
+
dirname('C:\\'); // Will return 'C:\' on Windows and '.' on *nix systems.
98
+
?>
99
+
]]>
100
+
</programlisting>
101
+
</informalexample>
102
+
</para>
103
+
</caution>
109
104
</refsect1>
110
105
111
106
<refsect1 role="examples">
112
107