php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15218 file_exists ('') returns TRUE
Submitted: 2002-01-25 01:44 UTC Modified: 2002-07-02 13:27 UTC
From: jlugton at iprimus dot com dot au Assigned:
Status: Closed Package: Filesystem function related
PHP Version: 4.1.0 OS: Windows XP
Private report: No CVE-ID: None
 [2002-01-25 01:44 UTC] jlugton at iprimus dot com dot au
The following will echo "I FOUND NOTHING!" on Windows XP running PHP (version 4.1.0), but on linux PHP (Version 4.0.4) returns FALSE which is correct.

<?php
  if (file_exists("")) echo "I FOUND NOTHING!" ;
?>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-04 11:40 UTC] lithron at bellsouth dot net
As a side note, perhaps the current version is correct.  Opening a blank file name in most console languages (Turbo C/Turbo Pascal), opens a handle to the console for input/output.

If you were planning on using PHP for console development, wouldn't you want an easy way to open the stdio types?
 [2002-04-04 12:49 UTC] derick@php.net
$f = fopen ("php://stdin", "r");
 [2002-07-02 13:27 UTC] sfox@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

The 'file' referred to is actually the current working directory.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 14:01:31 2024 UTC