Doc #43363 [Com]: Incorrect documentation for ZipArchive::locateName

From: Date: Fri, 20 May 2011 17:03:10 +0000
Subject: Doc #43363 [Com]: Incorrect documentation for ZipArchive::locateName
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-6646@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=43363&edit=1 ID: 43363 Comment by: m021 at springtimesoftware dot com Reported by: nick at magic-wand dot net Summary: Incorrect documentation for ZipArchive::locateName Status: Closed Type: Documentation Problem Package: Documentation problem Operating System: N/A PHP Version: Irrelevant Block user comment: N Private report: N New Comment: I believe the example is still incorrect, since this function is never documented to return TRUE (any comparison with TRUE may therefore not work properly). The comparison should be made with FALSE, which is the value returned when no entry with that name is found. Example: if ($zip->open($file)===FALSE) exit('no such entry found in the zip file'); Previous Comments: ------------------------------------------------------------------------ [2007-11-22 00:07:16] felipe@php.net This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. ------------------------------------------------------------------------ [2007-11-21 16:18:32] nick at magic-wand dot net Description: ------------ Example 2704 on the documentation page for ZipArchive::locateName incorrectly tests for equivalence with true for the zip->open() operation. This causes the example to exit when there's no error. Reproduce code: --------------- Lines 18-20 currently read: if ($zip->open($file) === TRUE) { exit('failed'); } They should read: if ($zip->open($file) !== TRUE) { exit('failed'); } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=43363&edit=1

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