From:             mahesh dot vemula at in dot ibm dot com
Operating system: RHEL 4
PHP version:      5CVS-2007-04-17 (snap)
PHP Bug Type:     Output Control
Bug description:  PHP does not handle overflow of octal integers

Description:
------------
Octal integer values which are beyond MAX_INT or MIN_INT value are not
converted to respective float values as expected, instead they are treated
as decimal values. Please see the example attached.

Environment:
Linux Kernal: Linux 2.6.9
PHP Version: PHP 5.2 (Built on Apr 17, 2007 from snaps.php.net)
PHP Configure Setup: ./configure



Reproduce code:
---------------
<?php
var_dump(017777777777);
var_dump(020000000000);
var_dump(020000000007);
var_dump(-017777777777);
var_dump(-020000000000);
var_dump(-020000000007);
?>


Expected result:
----------------
int(2147483647)
float(2147483648)
float(2147483655)
int(-2147483647)
int(-2147483648)
float(-2147483655)


Actual result:
--------------
int(2147483647)
float(2.0E+10)
float(20000000007)
int(-2147483647)
float(-2.0E+10)
float(-20000000007)


-- 
Edit bug report at http://bugs.php.net/?id=41118&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=41118&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=41118&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=41118&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=41118&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=41118&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=41118&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=41118&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=41118&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=41118&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=41118&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=41118&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=41118&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=41118&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=41118&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=41118&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=41118&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=41118&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=41118&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=41118&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=41118&r=mysqlcfg

Reply via email to