| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
  [2001-12-20 13:45 UTC] markmont at umich dot edu
 
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!
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             | 
    |||||||||||||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 12:00:01 2025 UTC | 
This works fine for me on Linux with the latest development CVS version of PHP (On Linux) provided that you use printf ("LONG_MIN -1 = %f", LONG_MIN - 1); instead, because the value of LONG_MIN - 1 does not fit in a field with %ld. Can you try this with the latest CVS version, and report back? Derick