#46421 [NEW]: SplFileInfo() behaves incorrectly when fed with '/'

From: Date: Wed, 29 Oct 2008 14:25:52 +0000
Subject: #46421 [NEW]: SplFileInfo() behaves incorrectly when fed with '/'
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-130298@lists.php.net to get a copy of this message
From: daniel dot gorski at develnet dot org Operating system: Linux PHP version: 5.3.0alpha2 PHP Bug Type: SPL related Bug description: SplFileInfo() behaves incorrectly when fed with '/' 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) -- Edit bug report at http://bugs.php.net/?id=46421&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=46421&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=46421&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=46421&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=46421&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=46421&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=46421&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=46421&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=46421&r=needscript Try newer version: http://bugs.php.net/fix.php?id=46421&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=46421&r=support Expected behavior: http://bugs.php.net/fix.php?id=46421&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=46421&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=46421&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=46421&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46421&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=46421&r=dst IIS Stability: http://bugs.php.net/fix.php?id=46421&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=46421&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=46421&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=46421&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=46421&r=mysqlcfg

« previous php.bugs (#130298) next »