Doc #80292 [Ver]: Incorrect use of code in manual's example codes.
| From: | cmb@php.net | Date: | Wed, 28 Oct 2020 12:56:47 +0000 |
| Subject: | Doc #80292 [Ver]: Incorrect use of code in manual's example codes. | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-18042@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80292&edit=1
ID: 80292
Updated by: cmb@php.net
Reported by: astrixoblix dot b at gmail dot com
Summary: Incorrect use of code in manual's example codes.
Status: Verified
Type: Documentation Problem
Package: Zip Related
PHP Version: Irrelevant
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Well, to clarify, the code works as it should because it is
equivalent to:
if (!($zip->status == ZipArchive::ER_OK)) {
However, that is clumsy and misleading.
Previous Comments:
------------------------------------------------------------------------
[2020-10-28 12:27:00] astrixoblix dot b at gmail dot com
Description:
------------
---
From manual page: https://php.net/ziparchive.locatename
---
In example #1 line #13 there's an additional exclamation mark by mistake.
I supposed the code has been changed from !$zip->status to $zip->status != ZipArchive::ER_OK
but correct code got lost during patches.
affected line:
if (!$zip->status == ZipArchive::ER_OK) {
correct line:
if ($zip->status != ZipArchive::ER_OK) {
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80292&edit=1