Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003127 [Quercus] major always 12-05-08 23:11 12-10-08 09:14
Reporter koreth View Status public  
Assigned To nam
Priority normal Resolution fixed Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version 4.0.0 Product Version 3.2.1
  Product Build
Summary 0003127: array_chunk() uses keys instead of values in result
Description <?php
$x = array_chunk(array(1 => 12345, 2 => 34567, 3 => 56789), 3);
print_r($x);

Vanilla PHP prints

Array
(
    [0] => Array
        (
            [0] => 12345
            [1] => 34567
            [2] => 56789
        )

)

Quercus prints

Array
(
    [0] => Array
        (
            [0] => 1
            [1] => 2
            [2] => 3
        )

)
Steps To Reproduce
Additional Information
Attached Files

- Relationships

- Notes
(0003578)
koreth
12-05-08 23:13

Trivial fix:

--- a/modules/quercus/src/com/caucho/quercus/lib/ArrayModule.java
+++ b/modules/quercus/src/com/caucho/quercus/lib/ArrayModule.java
@@ -198,7 +198,7 @@ public class ArrayModule
     int i = 0;
     for (Map.Entry<Value, Value> entry : array.entrySet()) {
       Value key = entry.getKey();
- Value value = entry.getKey();
+ Value value = entry.getValue();
 
       if (i % size == 0) {
         currentArray = new ArrayValueImpl();
 
(0003588)
nam
12-10-08 09:14

php/1715
 

- Issue History
Date Modified Username Field Change
12-05-08 23:11 koreth New Issue
12-05-08 23:13 koreth Note Added: 0003578
12-08-08 10:40 nam Status new => assigned
12-08-08 10:40 nam Assigned To  => nam
12-10-08 09:14 nam Status assigned => closed
12-10-08 09:14 nam Note Added: 0003588
12-10-08 09:14 nam Resolution open => fixed
12-10-08 09:14 nam Fixed in Version  => 4.0.0


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
31 total queries executed.
27 unique queries executed.
Powered by Mantis Bugtracker