Edit report at https://bugs.php.net/bug.php?id=74081&edit=1
ID: 74081
Updated by: requinix@php.net
Reported by: louvetj3 at outlook dot fr
Summary: question about function: file_exists()
-Status: Open
+Status: Not a bug
-Type: Documentation Problem
+Type: Bug
-Package: Website problem
+Package: Filesystem function related
Operating System: WIN10 / WAMP
PHP Version: 5.6.30
Block user comment: N
Private report: N
New Comment:
? is only special for URLs. If you're testing normal files then you have to have one actually
named "myFile.css?ver=09022017", which is not possible to do on Windows.
Previous Comments:
------------------------------------------------------------------------
[2017-02-10 20:28:08] louvetj3 at outlook dot fr
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 this bug report at https://bugs.php.net/bug.php?id=74081&edit=1