|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #62805 'A1' returned by geoip_country_code_by_name('');
Submitted: 2012-08-12 23:54 UTC Modified: 2012-11-15 10:24 UTC
From: jasen at treshna dot com Assigned: krakjoe (profile)
Status: Closed Package: geoip (PECL)
PHP Version: 5.3.15 OS: linux
Private report: No CVE-ID: None
 [2012-08-12 23:54 UTC] jasen at treshna dot com
From manual page:
"Returns the two letter ISO country code on success, or FALSE if the address cannot be found in the database. "

<?php echo geoip_country_code_by_name(''); ?>

got result: 'A1'

expected result: something from ISO3166 perhaps 'US'

'A1' is actually more useful - it seems to be the code for an 'anonymous proxy'

are there other special codes?

Test script:
<?php echo geoip_country_code_by_name(''); ?>

Expected result:
expected something from ISO3166 perhaps 'US'

Actual result:
got 'A1'


the documentation should be amended.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-11-15 10:24 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: krakjoe
 [2012-11-15 10:24 UTC]
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at

 For Windows:
Thank you for the report, and for helping us make PHP better.

Updated with a link to Maxmind which includes the descriptions of any special 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Jul 24 09:01:26 2021 UTC