php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #47511 undocumented: is_dir() returns true for symbolic links to directories
Submitted: 2009-02-26 15:04 UTC Modified: 2009-02-27 16:05 UTC
From: moquist at majen dot net Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: linux
Private report: No CVE-ID: None
 [2009-02-26 15:04 UTC] 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. :(

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-02-27 16:05 UTC] kalle@php.net
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.


 [2020-02-07 06:10 UTC] phpdocbot@php.net
Automatic comment on behalf of kalle
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=39d77121d250be2b7e2be9510b6b11fcdb5036b2
Log: Fixed #47511 (undocumented: is_dir() returns true for symbolic links to directories)
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Tue Oct 06 18:00:01 2026 UTC