Bug #2337: Referencing an array's element returns only 8k data

From: Date: Mon, 20 Sep 1999 16:39:54 +0000
Subject: Bug #2337: Referencing an array's element returns only 8k data
Groups: php.dev 
Request: Send a blank email to php-dev+get-11107@lists.php.net to get a copy of this message
From: thifi@telnet.hu Operating system: Linux 2.2.10, Debian Potato PHP version: 3.0.12 PHP Bug Type: Other Bug description: Referencing an array's element returns only 8k data I'm using Debian Potato's deb packages (3.0.12-5). I used a file in which lines are longer than 8k. When I read a file into an array with the "file" function and after I use "join" to join the elements into a string, the length of the joined string equals with the file's size. But when I try to extract an item from the array, I only get back 8190 byte. The problem only occurs when I use an array which is constructed by "file". script to test with: <? $array = file("test.txt"); $file = join("",$array); $size = filesize("test.txt"); echo("Reading the file into an array...\nFilesize: $size, Read in: ".strlen($file)."\n\n"); $file = file("test.txt"); $first = $file[0]; $file = fopen("test.txt","r"); $second = fgets($file,1000000); fclose($file); echo("Reading with \"file\" and \"fgets\"...\nFirst: ".strlen($first)." Second: ".strlen($second)."\n\n"); ?> test.txt's first line must be longer than 8190 bytes! Thanks, Thifi

« previous php.dev (#11107) next »