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 (profile)
Status: Closed Package: SPL related
PHP Version: 5.3.0alpha2 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: daniel dot gorski at develnet dot org
New email:
PHP Version: OS:

 

 [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-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 15:01:29 2024 UTC