|  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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
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
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:

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.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-10-07 07:48 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2020-10-07 07:48 UTC]
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: Sun Apr 14 08:01:29 2024 UTC