#25612 [Opn]: ip2long() and long2ip() results differs.

From: Date: Sat, 20 Sep 2003 11:00:20 +0000
Subject: #25612 [Opn]: ip2long() and long2ip() results differs.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-47872@lists.php.net to get a copy of this message
ID: 25612 Updated by: wez@php.net Reported By: marrtins at hackers dot lv Status: Open Bug Type: *Network Functions Operating System: Linux 2.4.20 PHP Version: 4.3.1 New Comment: 040 is octal for 32. Previous Comments: ------------------------------------------------------------------------ [2003-09-20 02:30:41] marrtins at hackers dot lv Description: ------------ Should ip address '62.234.229.040' differ from '62.234.229.40' ? I think not. Please check it out! Reproduce code: --------------- <?php printf("%u\n", ip2long('62.234.229.040')); // 1055581472 print long2ip('1055581472')."\n"; // 62.234.229.32 printf("%u\n", ip2long('62.234.229.40')); // 1055581480 ?> Expected result: ---------------- 1055581480 62.234.229.32 1055581480 Actual result: -------------- 1055581472 62.234.229.32 1055581480 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=25612&edit=1

« previous php.bugs (#47872) next »