#47511 [NEW]: undocumented: is_dir() returns true for symbolic links to directories
| From: | moquist at majen dot net | Date: | Thu, 26 Feb 2009 15:04:56 +0000 |
| Subject: | #47511 [NEW]: undocumented: is_dir() returns true for symbolic links to directories | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-1918@lists.php.net to get a copy of this message | ||
From: moquist at majen dot net
Operating system: linux
PHP version: Irrelevant
PHP Bug Type: Documentation problem
Bug description: undocumented: is_dir() returns true for symbolic links to directories
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 bug report at http://bugs.php.net/?id=47511&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=47511&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=47511&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=47511&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=47511&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=47511&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=47511&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=47511&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=47511&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=47511&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=47511&r=support
Expected behavior: http://bugs.php.net/fix.php?id=47511&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=47511&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=47511&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=47511&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47511&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=47511&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=47511&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=47511&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=47511&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=47511&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=47511&r=mysqlcfg