#47511 [Opn->Csd]: undocumented: is_dir() returns true for symbolic links to directories
ID: 47511
Updated by: kalle@php.net
Reported By: moquist at majen dot net
-Status: Open
+Status: Closed
Bug Type: Documentation problem
Operating System: linux
PHP Version: Irrelevant
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation
better.
Previous Comments:
------------------------------------------------------------------------
[2009-02-26 15:04:56] moquist at majen dot net
Description:
------------
If is_dir() wants to return true for symbolic links to directories
that's fine, but this should be mentioned in the documentation.
Cheers!
--matt
Reproduce code:
---------------
<?php
symlink('/etc/', '/tmp/imalink');
if (is_dir('/tmp/imalink')) {
print "Hmm. I think /tmp/imalink is a directory! The usually
excellent documentation at php.net didn't help me expect this result.
:(";
} else {
print "I think /tmp/imalink is not a directory, which is what I
would expect to be the case since I know it's a symlink.";
}
?>
Expected result:
----------------
I think /tmp/imalink is not a directory, which is what I would expect
to be the case since I know it's a symlink.
Actual result:
--------------
Hmm. I think /tmp/imalink is a directory! The usually excellent
documentation at php.net didn't help me expect this result. :(
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=47511&edit=1
Thread (2 messages)