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
 [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: Wed Jul 16 19:01:32 2025 UTC