#23793 [NEW]: file() and file_gets_content() cripple file content

From: Date: Sat, 24 May 2003 16:39:22 +0000
Subject: #23793 [NEW]: file() and file_gets_content() cripple file content
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-40352@lists.php.net to get a copy of this message
From: p dot klein at letsmakesense dot de Operating system: Windows XP PHP version: 4.3.2RC4 PHP Bug Type: Filesystem function related Bug description: file() and file_gets_content() cripple file content I used the following script to generate a text string text.php: $str = ""; for($i = 0; $i < 12950; $i++) { if($i%3 == 0) { $str .= "a"; } elseif($i%3 == 1) { $str .= "b"; } else { $str .= " "; } } echo $str; Then I read the file with either file() or file_get_contents() like: $url = "http://localhost/text.php"; $result = file_get_contents($url); /*$res_arr = file($url); $result = join("",$res_arr);*/ printf("%s\n", $result); With small files everything works fine. But starting from a file size of about 12950 bytes the functions the content of the test file gets crippled. The bigger the file the worse it gets. Large parts of file get cut. My system: OS: Windows XP home SP1 Server: Apache 2.0.44 PHP Verson: 4.3.2RC4 The bug cannot be reproduced when I call a text file by the file system (C:\text.txt) or using the php4ts.dll of PHP 4.3.1 -- Edit bug report at http://bugs.php.net/?id=23793&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=23793&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=23793&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=23793&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=23793&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=23793&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=23793&r=support Expected behavior: http://bugs.php.net/fix.php?id=23793&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=23793&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=23793&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=23793&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23793&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=23793&r=dst IIS Stability: http://bugs.php.net/fix.php?id=23793&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=23793&r=gnused

« previous php.bugs (#40352) next »