Anonymous | Login | Signup for a new account | 12-17-2024 08:47 PST |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
0003130 | [Quercus] | minor | always | 12-06-08 12:51 | 12-10-08 09:15 | ||||
Reporter | koreth | View Status | public | ||||||
Assigned To | nam | ||||||||
Priority | normal | Resolution | fixed | ||||||
Status | closed | Product Version | 3.2.1 | ||||||
Summary | 0003130: array_fill() should copy, not reference, values | ||||||||
Description |
Similar to bug 2930: <?php $x = array_fill(0, 2, array()); $x[0][] = 'foo'; print_r($x); This prints Array ( [0] => Array ( [0] => foo ) [1] => Array ( [0] => foo ) ) The second child array should be empty. The fix is similar to the previous bug's: --- a/modules/quercus/src/com/caucho/quercus/lib/ArrayModule.java +++ b/modules/quercus/src/com/caucho/quercus/lib/ArrayModule.java @@ -537,7 +537,7 @@ public class ArrayModule ArrayValue array = new ArrayValueImpl(); for (long k = start; k < num + start; k++) - array.put(LongValue.create(k), value); + array.put(LongValue.create(k), value.copy()); return array; } |
||||||||
Additional Information | |||||||||
Attached Files | |||||||||
|
Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
29 total queries executed. 26 unique queries executed. |