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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: pedro at boxwg dot info
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 14:04:04 2025 UTC