ID:               26839
 Updated by:       [EMAIL PROTECTED]
 Reported By:      dweller at devonweller dot com
-Status:           Open
+Status:           Verified
 Bug Type:         Arrays related
 Operating System: Linux Intel (Redhat)
-PHP Version:      4.3.4
+PHP Version:      4CVS-2004-01-08 (dev)
 New Comment:

$i < 32768 results in
array(2) {
  ["var1"]=>
  UNKNOWN:0
  ["var2"]=>
  UNKNOWN:0
}

$i < 32767 results in
array(2) {
  ["var1"]=>
  int(1)
  ["var2"]=>
  int(1)
}



Previous Comments:
------------------------------------------------------------------------

[2004-01-08 07:01:49] dweller at devonweller dot com

Description:
------------
The attached simple array routine produces unexpected 
results when the loop count is greater than approx. 
33000.  Perhaps this is some kind of reference counting 
bug.

Reproduce code:
---------------
// causes unexpected *RECURSION* references
$var1 = 1;
$array = array();
for($i=0;$i<33000;++$i) {
        $var2 = $var1;
        $array[] = array(
                'var1' => $var1,
                'var2' => $var2,
        );
}
print_r($array[0]);

Expected result:
----------------
Array
(
    [var1] => 1
    [var2] => 1
)

Actual result:
--------------
Array
(
    [var1] => Array
        (
            [var1] => Array
 *RECURSION*
            [var2] => Array
 *RECURSION*
        )

    [var2] => Array
        (
            [var1] => Array
 *RECURSION*
            [var2] => Array
 *RECURSION*
        )

)


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


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

Reply via email to