Doc #80193 [NEW]: Sample code correction

From: Date: Wed, 07 Oct 2020 07:43:41 +0000
Subject: Doc #80193 [NEW]: Sample code correction
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-17965@lists.php.net to get a copy of this message
From:             shaun at slickdesign dot com dot au
Operating system: 
PHP version:      7.4.11
Package:          Website problem
Bug Type:         Documentation Problem
Bug description:Sample code correction

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.


-- 
Edit bug report at https://bugs.php.net/bug.php?id=80193&edit=1
-- 
Fix committed:                    https://bugs.php.net/fix.php?id=80193&r=fixed
Fixed in release:                 https://bugs.php.net/fix.php?id=80193&r=alreadyfixed
Need backtrace:                   https://bugs.php.net/fix.php?id=80193&r=needtrace
Need Reproduce Script:            https://bugs.php.net/fix.php?id=80193&r=needscript
Try newer version:                https://bugs.php.net/fix.php?id=80193&r=oldversion
Not developer issue:              https://bugs.php.net/fix.php?id=80193&r=support
Expected behavior:                https://bugs.php.net/fix.php?id=80193&r=notwrong
Not enough info:                  https://bugs.php.net/fix.php?id=80193&r=notenoughinfo
Submitted twice:                  https://bugs.php.net/fix.php?id=80193&r=submittedtwice
register_globals:                 https://bugs.php.net/fix.php?id=80193&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80193&r=phptooold
Daylight Savings:                 https://bugs.php.net/fix.php?id=80193&r=dst
IIS Stability:                    https://bugs.php.net/fix.php?id=80193&r=isapi
Install GNU Sed:                  https://bugs.php.net/fix.php?id=80193&r=gnused
Floating point limitations:       https://bugs.php.net/fix.php?id=80193&r=float
No Zend Extensions:               https://bugs.php.net/fix.php?id=80193&r=nozend
MySQL Configuration Error:        https://bugs.php.net/fix.php?id=80193&r=mysqlcfg


Thread (2 messages)

« previous php.doc.bugs (#17965) next »