php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46421 SplFileInfo() behaves incorrectly when fed with '/'
Submitted: 2008-10-29 14:25 UTC Modified: 2008-11-06 01:11 UTC
From: daniel dot gorski at develnet dot org Assigned: colder
Status: Closed Package: SPL related
PHP Version: 5.3.0alpha2 OS: Linux
Private report: No CVE-ID:
 [2008-10-29 14:25 UTC] daniel dot gorski at develnet dot org
Description:
------------
SplFileInfo() behaves incorrectly when fed with '/', which denotes the root directory.

Reproduce code:
---------------
$info = new SplFileInfo('/');

var_dump($info->isDir());
var_dump($info->isReadable());
var_dump($info->getType());

Expected result:
----------------
bool(true)
bool(true)
string(3) "dir"


Actual result:
--------------
bool(false)
bool(false)
bool(false)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-06 01:11 UTC] colder@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Thu Apr 24 02:02:10 2014 UTC