Doc #74081 [NEW]: question about function: file_exists()
| From: | louvetj3 at outlook dot fr | Date: | Fri, 10 Feb 2017 20:28:09 +0000 |
| Subject: | Doc #74081 [NEW]: question about function: file_exists() | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-14432@lists.php.net to get a copy of this message | ||
From: louvetj3 at outlook dot fr
Operating system: WIN10 / WAMP
PHP version: 5.6.30
Package: Website problem
Bug Type: Documentation Problem
Bug description:question about function: file_exists()
Description:
------------
What is behavior of function file_exists($filename) if a version number
is added to filename ie: $filename='myFile.css?ver=09022017';
it seems that some times version number is
taken as part of fileName some times not.
directory: wcommander
file name: myFile.css
see script below
---
From manual page: http://www.php.net/function.file-exists
---
Test script:
---------------
$fileName= 'myFile.css?ver=09022017';
$repertoire = array('wcommander','wmembres','wactualites');
$root = (__DIR__);
$resultat = $fileName;
foreach($repertoire as $key => $value)
{
if(file_exists($root.'/'.$value.'/'.$fileName))
$resultat = $value.'/'.$fileName;
}
echo $resultat;
Expected result:
----------------
wcommander/myFile.css?ver=09022017
Actual result:
--------------
it seems that file is found because of version number
--
Edit bug report at https://bugs.php.net/bug.php?id=74081&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74081&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74081&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74081&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=74081&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=74081&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=74081&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=74081&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=74081&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=74081&r=support
Expected behavior: https://bugs.php.net/fix.php?id=74081&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=74081&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=74081&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=74081&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74081&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=74081&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=74081&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=74081&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=74081&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=74081&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=74081&r=mysqlcfg