Bug #2337 Updated: Referencing an array's element returns only 8k data
| From: | sander@php.net | Date: | Sun, 16 Jun 2002 12:58:15 +0000 |
| Subject: | Bug #2337 Updated: Referencing an array's element returns only 8k data | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-10693@lists.php.net to get a copy of this message | ||
ID: 2337
Updated by: sander@php.net
Reported By: thifi@telnet.hu
-Status: Open
+Status: Bogus
Bug Type: Other
Operating System: Linux 2.2.10, Debian Potato
PHP Version: 3.0.12
New Comment:
Thank you for taking the time to report a problem with PHP.
Unfortunately, PHP 3 is no longer supported. Please download
the latest version of PHP 4 from http://www.php.net/downloads.php
If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.
Previous Comments:
------------------------------------------------------------------------
[1999-09-20 12:39:54] thifi@telnet.hu
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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=2337&edit=1