Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004330 [Quercus] minor always 12-17-10 14:22 01-05-11 20:02
Reporter gbruins View Status public  
Assigned To
Priority normal Resolution open Platform
Status new   OS
Projection none   OS Version
ETA none Fixed in Version Product Version
  Product Build
Summary 0004330: Multidimensional arrays not working properly
Description $arr = array();
$arr['one'] = array();
$arr['one']['two'] = 2;
$arr['one']['three'] = 3;
print_r($arr);

Expected result:
Array
(
    [one] => Array
        (
            [two] => 2
            [three] => 3
        )

)


However this is being printed:
Array
(
    [one] => Array
)


Steps To Reproduce
Additional Information
Attached Files

- Relationships

- Notes
(0004880)
gbruins
12-17-10 14:31

this is happening on resin 4.0.13
 
(0004881)
gbruins
12-17-10 14:40

BTW, the problem is not with the print_r() function, as this array will print the expected result:

$test = array('one' => array('two' => 2, 'three' => 3));
print_r($test);

// prints:
Array
(
    [one] => Array
        (
            [two] => 2
            [three] => 3
        )

)
 
(0004882)
gbruins
12-17-10 14:42

I don't believe this was an issue on resin-4.0.10
 
(0004890)
Craige
01-05-11 20:02

@gbruins. I disagree; this is a problem with print_r. Proven through:

$arr = array();
$arr['one'] = array();
$arr['one']['two'] = 2;
$arr['one']['three'] = 3;
var_dump($arr); // <--------

Which results in.....


array(1) {
  ["one"]=>
  &array(2) {
    ["two"]=>
    int(2)
    ["three"]=>
    int(3)
  }
}
 

- Issue History
Date Modified Username Field Change
12-17-10 14:22 gbruins New Issue
12-17-10 14:31 gbruins Note Added: 0004880
12-17-10 14:40 gbruins Note Added: 0004881
12-17-10 14:42 gbruins Note Added: 0004882
01-05-11 20:02 Craige Note Added: 0004890


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