|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-06-30 00:23 UTC] caleblangeslag at hotmail dot com
[2007-06-30 02:15 UTC] rasmus@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 15:00:01 2025 UTC |
Description: ------------ filesize() returns '0' with any file and does not raise an error even though error_reporting is enabled. Also keep in note that I am using the software bundle named "XAMPP" and have upgraded the version of PHP 4. I've also checked the existance of the file. I can include the file using include() perfectly, however filesize() only returns 0 but not an error. When I change $filename to an invalid filename, filesize() does produce an error. I've also tried clearstatcache() and it made no difference. Reproduce code: --------------- class classname { function somefunction() { $filename = "tpl/default/nav.inc.php"; $handle = fopen($filename, 'r'); // Works (doesn't return FALSE) $content = fread($handle,filesize($filename)); // fails because filesize() returns 0. } } Expected result: ---------------- Contents of the file Actual result: -------------- Warning: fread() [function.fread]: Length parameter must be greater than 0. in C:\Program Files\xampp\htdocs\KeenManager\include\core.php on line 1411 (Where line 1411 is: $content = fread($handle,filesize($filename));