|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-01-06 16:50 UTC] sniper@php.net
[2006-01-06 16:55 UTC] cpuidle at gmx dot de
[2006-01-13 12:00 UTC] vrana@php.net
[2006-01-16 09:19 UTC] cpuidle at gmx dot de
[2006-01-30 16:48 UTC] vrana@php.net
[2006-02-26 19:00 UTC] cpuidle at gmx dot de
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 16:00:01 2025 UTC |
Description: ------------ I'm experiencing a very weird bug where fread is limited to 8K though the source file (ANSI) is bigger than 8K. I was not able to reproduce the bug standalone, only inside a complex application. This does not happen with PHP5.0.5, but with 5.1.1. Unfortunately the sample code does not reproduce the problem standalone, but demonstrates the effect. Reproduce code: --------------- function _read_file($filename) { if ( file_exists($filename) && ($fd = @fopen($filename, 'rb')) ) { $contents = ($size = filesize($filename)) ? fread($fd, $size) : ''; echo("_read_file($filename) \$size: $size strlen(\$contents): ".strlen($contents)."<br/>"); fclose($fd); } } _read_file('templates/elegant/\show.tpl'); Expected result: ---------------- Output: _read_file(templates/elegant/\show.tpl) $size: 9520 strlen($contents): 9520 Actual result: -------------- Output: _read_file(templates/elegant/\show.tpl) $size: 9520 strlen($contents): 8192