ID: 16830
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Analyzed
Bug Type: Filesystem function related
Operating System: ANY
PHP Version: 4.3.0-dev
New Comment:
something stinks here:
[2002-04-27 10:41:44] [EMAIL PROTECTED]
$filename="";
$bb = is_file($filename);
var_dump($bb);
int(0)
yohgaki:
$filename="";
$bb = is_file($filename);
var_dump($bb);
bool(false)
so does is_file() return false or 0? plus it returned int(1) for you,
which it shouldn't either (should return bool(true) instead). WTF?
Previous Comments:
------------------------------------------------------------------------
[2002-04-27 20:09:29] [EMAIL PROTECTED]
I added following test case (ext/standard/tests/file/003.phpt)
<?php
$filename="";
$bb = is_file($filename);
var_dump($bb);
$aa = file_exists($filename);
var_dump($aa);
$filename="php.ini-dist";
$bb = is_file($filename);
var_dump($bb);
$aa = file_exists($filename);
var_dump($aa);
?>
Result:
[yohgaki@dev HEAD]$ cat ext/standard/tests/file/003.out
bool(false)
bool(false)
int(1)
bool(true)
------------------------------------------------------------------------
[2002-04-27 19:57:58] [EMAIL PROTECTED]
Just curious, is this fixed?
(I was about to commit test case for this bug)
[yohgaki@dev HEAD]$ ./cli-php ext/standard/tests/file/003.inc
bool(false)
bool(false)
------------------------------------------------------------------------
[2002-04-27 13:09:43] [EMAIL PROTECTED]
Jani, the var_dump()s IMO show two bugs: the other is that is_file()
returned int(0), while it's documented to be a bool type. could you
check this too?
------------------------------------------------------------------------
[2002-04-27 10:41:44] [EMAIL PROTECTED]
Duh. You're right, it's a bug.
<?php
$filename="";
$bb = is_file($filename);
var_dump($bb);
$aa = file_exists($filename);
var_dump($aa);
?>
Outputs:
int(0)
bool(true)
--Jani
------------------------------------------------------------------------
[2002-04-27 00:27:58] [EMAIL PROTECTED]
c:\winnt\system32\php4ts.dll matches the php4ts.dll from the php 4.2.0
package. All other PHP files are in php's own directory. When I install
a new version of PHP, I always delete the whole old PHP directory and
create a new one to prevent keeping rests from old versions. I also
always use the new php.ini-dist and modify it again instead of keeping
the old php.ini.
Additionally, in the last PHP version I had installed (4.1.2),
file_exists() DID work! It just stopped working with PHP 4.2.0, so I
doubt that error could be from forgetting to overwrite old DLLs with
new ones.
What does the script I posted before say for _you_, Jani?
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/16830
--
Edit this bug report at http://bugs.php.net/?id=16830&edit=1