php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #37207 fgets example
Submitted: 2006-04-26 10:15 UTC Modified: 2006-04-26 10:21 UTC
From: hanwoody at gmail dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: hanwoody at gmail dot com
New email:
PHP Version: OS:

 

 [2006-04-26 10:15 UTC] hanwoody at gmail dot com
Description:
------------
http://cn.php.net/manual/zh/function.fgets.php

<?php
$handle = fopen("/tmp/inputfile.txt", "r");
while (!feof($handle)) {
   $buffer = fgets($fd, 4096);
   echo $buffer;
}
fclose($handle);
?> 

Reproduce code:
---------------
<?php
$handle = fopen("/tmp/inputfile.txt", "r");
while (!feof($handle)) {
   $buffer = fgets($fd, 4096);
   echo $buffer;
}
fclose($handle);
?> 

Expected result:
----------------
<?php
$handle = fopen("/tmp/inputfile.txt", "r");
while (!feof($handle)) {
   $buffer = fgets($handle, 4096);
   echo $buffer;
}
fclose($handle);
?> 


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-26 10:21 UTC] vrana@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 07:01:31 2025 UTC