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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Thu Jan 02 12:01:29 2025 UTC