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

 ID:                 51430
 Updated by:         cataphr...@php.net
 Reported by:        will at flourishlib dot com
 Summary:            Numeric string array key is being implicitly cast to
                     32bit int and overflowing
-Status:             Open
+Status:             Duplicate
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   Fedora 12 x86, OpenSuse 11 x86
 PHP Version:        5.3.3RC1
 Block user comment: N

 New Comment:

Dup of #51008.


Previous Comments:
------------------------------------------------------------------------
[2010-06-18 15:17:08] will at flourishlib dot com

I just built PHP 5.3.3RC1 on both my Fedora x86 and OpenSuse x86
machines and the bug is present in 

both.





The commands used for each:



# wget http://downloads.php.net/johannes/php-5.3.3RC1.tar.bz2

# tar xvfj php-5.3.3RC1.tar.bz2

# cd php-5.3.3RC1

# ./configure

# make

# cd sapi/cli/

# ./php -r 'print_r(array("-2147483649" => TRUE, "-2147483648" =>
FALSE));'

Array

(

    [2147483647] => 1

    [-2147483648] =>

)





The uname -a from each:



Linux vm-fedora 2.6.31.12-174.2.22.fc12.i686.PAE #1 SMP Fri Feb 19
19:10:04 UTC 2010 i686 i686 i386 

GNU/Linux



Linux vm-opensuse 2.6.31.12-0.1-desktop #1 SMP PREEMPT 2010-01-27
08:20:11 +0100 i686 i686 i386 

GNU/Linux





Since there was some speculation that this may be a compiler issue, here
is gcc -v for each:



Using built-in specs.

Target: i686-redhat-linux

Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --with-

bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap
--enable-shared --enable-threads=posix --

enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --

enable-gnu-unique-object
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada
--enable-java-awt=gtk --

disable-dssi --enable-plugin
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre
--enable-libgcj-

multifile --enable-java-maintainer-mode
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-

libjava-multilib --with-ppl --with-cloog --with-tune=generic
--with-arch=i686 --build=i686-redhat-linux

Thread model: posix

gcc version 4.4.3 20100127 (Red Hat 4.4.3-4) (GCC)



Using built-in specs.

Target: i586-suse-linux

Configured with: ../configure --prefix=/usr --infodir=/usr/share/info
--mandir=/usr/share/man --

libdir=/usr/lib --libexecdir=/usr/lib
--enable-languages=c,c++,objc,fortran,obj-c++,java,ada --enable-

checking=release --with-gxx-include-dir=/usr/include/c++/4.4
--enable-ssp --disable-libssp --with-

bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux'
--disable-libgcj --disable-libmudflap --

with-slibdir=/lib --with-system-zlib --enable-__cxa_atexit
--enable-libstdcxx-allocator=new --disable-

libstdcxx-pch --enable-version-specific-runtime-libs
--program-suffix=-4.4 --enable-linux-futex --

without-system-libunwind --with-arch-32=i586 --with-tune=generic
--build=i586-suse-linux

Thread model: posix

gcc version 4.4.1 [gcc-4_4-branch revision 150839] (SUSE Linux)

------------------------------------------------------------------------
[2010-06-12 18:51:09] paj...@php.net

@colder I don't think we ever supported 64bit numeric on 32bit
platforms.

------------------------------------------------------------------------
[2010-06-11 15:52:36] will at flourishlib dot com

Here is the info from the original 32bit machine that also sees the bug
in 

5.3.3-dev:



# ./php -v

PHP 5.3.3-dev (cli) (built: Jun 11 2010 09:48:12)

Copyright (c) 1997-2010 The PHP Group

Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies



# ./php -r 'print_r(array("-2147483649" => TRUE, "-2147483648" =>
FALSE));'

Array

(

    [2147483647] => 1

    [-2147483648] =>

)



# uname -a

Linux vm-fedora 2.6.31.12-174.2.22.fc12.i686.PAE #1 SMP Fri Feb 19
19:10:04 UTC 

2010 i686 i686 i386 GNU/Linux



# gcc -v

Using built-in specs.

Target: i686-redhat-linux

Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --

infodir=/usr/share/info
--with-bugurl=http://bugzilla.redhat.com/bugzilla --

enable-bootstrap --enable-shared --enable-threads=posix --enable-

checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-

exceptions --enable-gnu-unique-object
--enable-languages=c,c++,objc,obj-

c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi
--enable-plugin --

with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre
--enable-libgcj-multifile 

--enable-java-maintainer-mode
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar --

disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic
--with-

arch=i686 --build=i686-redhat-linux

Thread model: posix

gcc version 4.4.3 20100127 (Red Hat 4.4.3-4) (GCC)

------------------------------------------------------------------------
[2010-06-11 15:35:56] will at flourishlib dot com

Both 5.3.3-dev and trunk were built on the following machine:



# uname -a

Linux vm-opensuse 2.6.31.12-0.1-desktop #1 SMP PREEMPT 2010-01-27
08:20:11 +0100 i686 i686 i386 GNU/Linux



# gcc -v

Using built-in specs.

Target: i586-suse-linux

Configured with: ../configure --prefix=/usr --infodir=/usr/share/info
--mandir=/usr/share/man --libdir=/usr/lib 

--libexecdir=/usr/lib
--enable-languages=c,c++,objc,fortran,obj-c++,java,ada
--enable-checking=release --with-

gxx-include-dir=/usr/include/c++/4.4 --enable-ssp --disable-libssp
--with-bugurl=http://bugs.opensuse.org/ --

with-pkgversion='SUSE Linux' --disable-libgcj --disable-libmudflap
--with-slibdir=/lib --with-system-zlib --

enable-__cxa_atexit --enable-libstdcxx-allocator=new
--disable-libstdcxx-pch --enable-version-specific-runtime-

libs --program-suffix=-4.4 --enable-linux-futex
--without-system-libunwind --with-arch-32=i586 --with-

tune=generic --build=i586-suse-linux

Thread model: posix

gcc version 4.4.1 [gcc-4_4-branch revision 150839] (SUSE Linux)

------------------------------------------------------------------------
[2010-06-11 15:27:41] col...@php.net

Apparently it's still reproducible in some environments with the latest
5.3 

snapshot, Not on mine though.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    http://bugs.php.net/bug.php?id=51430


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

Reply via email to