reference/filesystem/functions/dirname.xml
67ca0d930c95a85ea49aff456409409f6ae06c1b
...
...
@@ -82,6 +82,25 @@
82
82
<parameter>path</parameter> with any trailing
83
83
<literal>/component</literal> removed.
84
84
</para>
85
+

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>
85
104
</refsect1>
86
105

87
106
<refsect1 role="changelog">
88
107