php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65324 NULL returned by geoip_record_by_name
Submitted: 2013-07-24 14:22 UTC Modified: 2014-12-30 10:42 UTC
Votes:3
Avg. Score:4.0 ± 1.4
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: renaudd at gmail dot com Assigned:
Status: No Feedback Package: geoip (PECL)
PHP Version: 5.4.17 OS: Linux (multi)
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2013-07-24 14:22 UTC] renaudd at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.geoip-record-by-name#refsect1-
function.geoip-record-by-name-returnvalues
---

Up to (and including) php 5.4.14, an geoip_record_by_name was returning FALSE 
when the record was not found. (as stated in 
the doc)

On 5.4.15 and 5.4.17, it returns NULL.

Some examples: (geoip 1.0.8)

~$ php -v
PHP 5.4.13-1~dotdeb.1 (cli) (built: Mar 21 2013 08:29:56) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
    with the ionCube PHP Loader v4.4.1, Copyright (c) 2002-2013, by ionCube 
Ltd., and
    with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans
~$ php -r 'var_dump(@geoip_record_by_name("192.168.1.1"));'
bool(false)

---

~$ php -v
PHP 5.4.14-1~dotdeb.1 (cli) (built: Apr 21 2013 05:21:34) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
    with Xdebug v2.2.2, Copyright (c) 2002-2013, by Derick Rethans
~$ php -r 'var_dump(@geoip_record_by_name("192.168.1.1"));'
bool(false)

---

~$ php -v
PHP 5.4.15-1~dotdeb.1 (cli) (built: May 11 2013 19:59:55) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
    with the ionCube PHP Loader v4.4.1, Copyright (c) 2002-2013, by ionCube 
Ltd., and
    with Xdebug v2.2.2, Copyright (c) 2002-2013, by Derick Rethans

~$ php -r 'var_dump(@geoip_record_by_name("192.168.1.1"));'
NULL

---

~$ php -v
PHP 5.4.17-1~precise+1 (cli) (built: Jul 17 2013 18:14:06) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
~$ php -r 'var_dump(@geoip_record_by_name("192.168.1.1"));'
NULL


Renaud



Test script:
---------------
var_dump(geoip_record_by_name("192.168.1.1"));

Expected result:
----------------
bool(false)

Actual result:
--------------
NULL

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-04-28 12:42 UTC] ohill@php.net
-Status: Open +Status: Feedback
 [2014-04-28 12:42 UTC] ohill@php.net
Can you try the version on SVN? I think it's related to the notice being returned. The new version doesn't output a notice, just returns FALSE.
 [2014-12-30 10:42 UTC] pecl-dev at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Jan 29 05:01:24 2020 UTC