ID: 26170
Updated by: [EMAIL PROTECTED]
Reported By: phpbugspam at netebb dot com
Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Windows 2000 SP4
PHP Version: 5.0.0b2 (beta2)
New Comment:
Numbers starting with 0 are treated as octal; 09 is invalid octal.
[This is a feature of the socket libraries on most OS,
and is not PHP specific]
Solution: don't use numbers with leading 0's
Previous Comments:
------------------------------------------------------------------------
[2003-11-07 21:37:06] [EMAIL PROTECTED]
Unable to confirm.
Works locally on Win2K/SP4, Linux 2.4.22, and FreeBSD 5.1
------------------------------------------------------------------------
[2003-11-07 20:05:20] phpbugspam at netebb dot com
Description:
------------
Line 4 (09.0.0.0) fails in the following code.
Fails on both 4.3.4 and 5.0.0b2.
Haven't tried it in *nix.
Thanks,
Ross
Reproduce code:
---------------
<?php
ini_set('html_errors', false);
assert(ip2long('1.0.0.0') == ip2long('01.0.0.0'));
assert(ip2long('9.0.0.0') == ip2long('09.0.0.0'));
echo 'phpversion=',phpversion();
?>
Expected result:
----------------
Nothing.
Actual result:
--------------
$ php -q bug_ip2long.php
Warning: assert(): Assertion failed in
c:\ross\freebeer\www\demo\bug_ip2long.php on line 4
phpversion=4.3.4
$ php -q bug_ip2long.php
Warning: assert(): Assertion failed in
c:\ross\freebeer\www\demo\bug_ip2long.php on line 4
phpversion=5.0.0b2
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=26170&edit=1