Doc #52855 [Opn->Wfx]: Incorrect example provided for geoip-db-avail
| From: | aharvey@php.net | Date: | Thu, 16 Sep 2010 07:09:18 +0000 |
| Subject: | Doc #52855 [Opn->Wfx]: Incorrect example provided for geoip-db-avail | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-5057@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=52855&edit=1
ID: 52855
Updated by: aharvey@php.net
Reported by: james dot widdowson at tiscali dot co dot uk
Summary: Incorrect example provided for geoip-db-avail
-Status: Open
+Status: Wont fix
Type: Documentation Problem
Package: Documentation problem
PHP Version: 5.3.3
Block user comment: N
New Comment:
Actually, that looks correct to me: the intention of the example seems
to be to demonstrate that you would use geoip_db_avail() before making
any other calls that use the GeoIP database, such as
geoip_database_info().
Closing won't fix.
Previous Comments:
------------------------------------------------------------------------
[2010-09-15 15:33:44] james dot widdowson at tiscali dot co dot uk
Description:
------------
The example provided on the following page is incorrect:
http://www.php.net/manual/en/function.geoip-db-avail.php
Example #1 A geoip_db_avail() example
This will output the current database version string.
<?php
if (geoip_db_avail(GEOIP_COUNTRY_EDITION))
print geoip_database_info(GEOIP_COUNTRY_EDITION);
?>
The above example will output:
GEO-106FREE 20080801 Build 1 Copyright (c) 2006 MaxMind LLC All Rights
Reserved
The incorrect function (geoip_database_info rather than
geoip_db_avail)is being used in the print statement which means the
output displayed is incorrect for the function being described. It
should be a bool.
Expected result:
----------------
Example #1 A geoip_db_avail() example
This will output the current database version string.
<?php
if (geoip_db_avail(GEOIP_COUNTRY_EDITION))
print geoip_db_avail(GEOIP_COUNTRY_EDITION);
?>
The above example will output:
True
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=52855&edit=1