From:             [EMAIL PROTECTED]
Operating system: Solaris 8, 64-bit
PHP version:      4.1.0
PHP Bug Type:     *General Issues
Bug description:  integers wrapping around rather than being promoted into floats on 
overflow


This problem causes all tests in ext/standard/tests/math to fail:

<?php
  define('LONG_MAX', is_int(5000000000)? 9223372036854775807
    : 0x7FFFFFFF);
  define('LONG_MIN', -LONG_MAX - 1);
  printf("%d,%d,%d,%d\n",is_int(LONG_MIN  ),is_int(LONG_MAX  ),
                                    
is_int(LONG_MIN-1),is_int(LONG_MAX+1));
 
  printf( "LONG_MIN = %ld, LONG_MIN - 1 = %ld\n",
    LONG_MIN, LONG_MIN - 1 );
  printf( "LONG_MAX = %ld, LONG_MAX + 1 = %ld\n",
    LONG_MAX, LONG_MAX + 1 );

?>

This script gives the following results on my system:

1,1,1,1
LONG_MIN = -9223372036854775808, LONG_MIN - 1 = 9223372036854775807
LONG_MAX = 9223372036854775807, LONG_MAX + 1 = -9223372036854775808

Here's my setup:

PHP 4.1.0 compiled as a 64-bit stand-alone interpreter (CGI).

Hardware:  Sun Blade 1000 (750MHz UltraSparc III processor)
OS:        Solaris 8 07/01, running a 64-bit kernel
Compiler:  Sun Forte 6 update 2


env CC="cc -fast -xtarget=generic64" CFLAGS="-v -I/opt/include" \
    CXX="CC -fast -xtarget=generic64 -v" \
    LDFLAGS="-R/opt/lib/sparcv9 -R/opt/lib -L/opt/lib/sparcv9 -L/opt/lib"
\
    ac_cv_path_install='/usr/sbin/install' \
  ./configure --prefix=/opt/packages/php-4.1.0 \
    --enable-force-cgi-redirect --enable-discard-path --enable-trans-sid
\
    --with-config-file-path=/opt/www/etc \
    --with-exec-dir=/opt/packages/php-4.1.0/bin --with-mm=/opt --with-zlib
\
    --with-zlib-dir=/opt --with-expat-dir=/opt --with-mysql
--with-gdbm=/opt \
    --with-gd=yes --enable-gd-native-ttf   --with-xpm-dir=/opt \
--with-jpeg-dir=/opt --with-png-dir=/opt --with-freetype-dir=/opt \
    --enable-freetype-4bit-antialias-hack
 
I hope this helps.  Any thoughts as to what the problem could be?
If I can be of help in fixing it, just let me know.

Thanks!

-- 
Edit bug report at: http://bugs.php.net/?id=14630&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to