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
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: 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

Pull Requests

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: Sat Dec 21 18:01:29 2024 UTC