php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #80193 Sample code correction
Submitted: 2020-10-07 07:43 UTC Modified: 2020-10-07 07:48 UTC
From: shaun at slickdesign dot com dot au Assigned: cmb (profile)
Status: Closed Package: Website problem
PHP Version: 7.4.11 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: shaun at slickdesign dot com dot au
New email:
PHP Version: OS:

 

 [2020-10-07 07:43 UTC] shaun at slickdesign dot com dot au
Description:
------------
Hi Team,

It's been pointed out to me that I have an error in the sample code of one of my comments and I am unsure how to correct the issue. The comment is question is one I submitted about 2 years ago, and it can be found here:
https://www.php.net/manual/en/function.fgetcsv.php#122696

I'm unsure if the example I provided is how I would do things now, but the point remains that the sample code does not work because one of the variable names is incorrect.

The line in question is as follows:
if (fgets($fp, 4) !== $fp) {

The correction would be to change the second variable from $fp to $bom. Example:
if (fgets($fp, 4) !== $bom) {

If you are able to correct my mistake, that would be greatly appreciated.

Thanks, Shaun.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-10-07 07:48 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2020-10-07 07:48 UTC] cmb@php.net
The code has been fixed.  It will take a while until the change is
rolled out to the Website.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Feb 22 05:01:28 2024 UTC