php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46901 ip2long() giving negative results
Submitted: 2008-12-18 14:20 UTC Modified: 2008-12-18 14:28 UTC
From: pedro at boxwg dot info Assigned:
Status: Not a bug Package: PHP options/info functions
PHP Version: 5.2.8 OS: Linux
Private report: No CVE-ID: None
 [2008-12-18 14:20 UTC] pedro at boxwg dot info
Description:
------------
Just bumped into a somehow weird bug, reported a couple years ago and it just popped up once again

$ip = "161.51.11.2";
echo(ip2long($ip));

returns -1590490366


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-12-18 14:28 UTC] jani@php.net
Expected behaviour. To make it portable:

# php -r 'echo printf("%u", ip2long("161.51.11.2"));
270447693010

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 19 11:01:37 2024 UTC