Expanded docs to take into account empty file names and missing files, and linked to realpath(). This deals with a user note by josef.vlk.d@gmail.com

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@337752 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Philip Olson 2015-09-04 17:42:41 +00:00
parent 6156d1a148
commit 3a18df636a

View file

@ -26,7 +26,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the path to the file.
Returns the path to the file, or &false; if the file does not exist.
</para>
</refsect1>
@ -43,6 +43,12 @@ var_dump($info->getRealPath());
$info = new SplFileInfo('/tmp');
var_dump($info->getRealPath());
$info = new SplFileInfo('/I/Do/Not/Exist');
var_dump($info->getRealPath());
$info = new SplFileInfo("");
var_dump($info->getRealPath());
?>
]]>
</programlisting>
@ -51,6 +57,8 @@ var_dump($info->getRealPath());
<![CDATA[
string(28) "/private/tmp/phptempfile.php"
string(12) "/private/tmp"
bool(false)
string(12) "/private/tmp"
]]>
</screen>
</example>
@ -62,6 +70,7 @@ string(12) "/private/tmp"
<para>
<simplelist>
<member><methodname>SplFileInfo::isLink</methodname></member>
<member><methodname>realpath</methodname></member>
</simplelist>
</para>
</refsect1>