php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23793 file() and file_gets_content() cripple file content
Submitted: 2003-05-24 11:39 UTC Modified: 2003-05-24 11:41 UTC
From: p dot klein at letsmakesense dot de Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 4.3.2RC4 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: p dot klein at letsmakesense dot de
New email:
PHP Version: OS:

 

 [2003-05-24 11:39 UTC] p dot klein at letsmakesense dot de
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



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-24 11:41 UTC] moriyoshi@php.net
Dupe of bug #23770
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jun 02 08:01:31 2024 UTC