|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74081 question about function: file_exists()
Submitted: 2017-02-10 20:28 UTC Modified: 2017-02-11 07:59 UTC
From: louvetj3 at outlook dot fr Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 5.6.30 OS: WIN10 / WAMP
Private report: No CVE-ID: None
 [2017-02-10 20:28 UTC] louvetj3 at outlook dot fr
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:

Test script:
$fileName= 'myFile.css?ver=09022017';
$repertoire = array('wcommander','wmembres','wactualites');
$root = (__DIR__);
$resultat = $fileName;
foreach($repertoire as $key => $value)
		$resultat = $value.'/'.$fileName;
echo $resultat;

Expected result:

Actual result:
it seems that file is found because of version number


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-02-11 07:59 UTC]
-Status: Open +Status: Not a bug -Type: Documentation Problem +Type: Bug -Package: Website problem +Package: Filesystem function related
 [2017-02-11 07:59 UTC]
? 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.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Jul 31 11:01:23 2021 UTC