php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #15947 It's code wrong or document wrong about fgets
Submitted: 2002-03-08 01:29 UTC Modified: 2002-03-08 08:26 UTC
From: yorgo at 163 dot net Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 4.1.2 OS: linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: yorgo at 163 dot net
New email:
PHP Version: OS:

 

 [2002-03-08 01:29 UTC] yorgo at 163 dot net
On fgets() document is write

string fgets ( int fp [, int length])

bug is you just write php code like

$string = fget($fp);

it will print out some warn info about "Wrong parameter count".

when I check the source code on fgets(), it writed
if (ARG_COUNT(ht) != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
   WRONG_PARAM_COUNT;
}

I think it must not ARG_COUNT(ht) != 2

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-03-08 02:39 UTC] derick@php.net
Documentation is correct here, but the 2nd parameter is only optional in php 4.2.0 and higher (not released yet).

Derick
 [2002-03-08 06:21 UTC] sander@php.net
Reclassified.
 [2002-03-08 08:26 UTC] alindeman@php.net
Documentation is fine.  There is a note about this (that this is only optional in 4.2.0) in the documentation.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 15 08:01:31 2025 UTC