|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51008 Zend/tests/bug45877.phpt fails
Submitted: 2010-02-11 01:54 UTC Modified: 2010-10-05 13:29 UTC
From: geissert at debian dot org Assigned: dmitry
Status: Closed Package: Scripting Engine problem
PHP Version: 5.3SVN-2010-02-12 OS: debian sid
Private report: No CVE-ID:
 [2010-02-11 01:54 UTC] geissert at debian dot org
The test fails 

Reproduce code:
$keys = array(PHP_INT_MAX,
        (string) PHP_INT_MAX,
        (string) (-PHP_INT_MAX - 1),
        -PHP_INT_MAX - 1,
        (string) (PHP_INT_MAX + 1));

var_dump(array_fill_keys($keys, 1));

Expected result:
array(2) {

Actual result:
array(2) {


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-02-12 17:02 UTC]
In what kind of environment does it fail? It works fine for me in both 32bit and 64bit systems. (using latest SVN checkout of course :)
 [2010-02-12 18:58 UTC] geissert at debian dot org
It fails for me with 5.3.1 on i686, ia64, s390, alpha, powerpc, x86_64, etc. Even on those running kfreebsd.
It also fails with the latest 5.3 svn on ia64 (haven't built it on any other arch.)
 [2010-02-22 18:05 UTC]
Possibly same issue as bug #51023 ??
 [2010-02-22 23:47 UTC]
Indeed. I just checked with the -O0 build and it passes.

The affected code in this case is ZEND_HANDLE_NUMERIC in Zend/zend_hash.h

Should this one be assigned to somebody in particular?
 [2010-02-23 13:05 UTC]
 [2010-03-06 20:02 UTC]
-Status: Bogus +Status: Open
 [2010-03-06 20:02 UTC]
Reopening it because somebody with commit access to the engine needs to apply and commit the patch there. The other patch can be found at;a=blob;f=debian/patches/zend_int_overflow.patch;hb=0fe497525d46b2fa8353e37106b47c05ef804cc5
 [2010-09-29 17:54 UTC]
-Assigned To: +Assigned To: dmitry
 [2010-09-29 17:54 UTC]
See also and

The current implementation relies on undefined behavior and apparently the overflow check can be optimized away.
 [2010-10-05 13:28 UTC]
Automatic comment from SVN on behalf of dmitry
Log: Fixed bug #51008 (Zend/tests/bug45877.phpt fails)
 [2010-10-05 13:29 UTC]
-Status: Assigned +Status: Closed
 [2010-10-05 13:29 UTC]
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Tue Oct 06 16:01:33 2015 UTC