Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001103 [Quercus] minor always 05-12-06 20:35 05-15-06 15:04
Reporter koreth View Status public  
Assigned To ferg
Priority normal Resolution fixed Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version 3.0.20 Product Version 3.0.19
  Product Build
Summary 0001103: array_merge() doesn't deal properly with NULL argument (w/fix)
Description <?php
$array = array_merge((array)NULL, (array)NULL);
var_dump($array);
?>

Quercus outputs an array of two NULL elements. Normal PHP outputs an empty array.

Fix is to replace

      if (! (arg.toValue() instanceof ArrayValue))

with

      if (! (arg.toValue() instanceof ArrayValue) || arg.toValue().isNull())

in ArrayModule.array_merge().
Steps To Reproduce
Additional Information
Attached Files

- Relationships

- Notes
(0001125)
koreth
05-12-06 20:47

Hmm, scratch that fix -- it seemed to work once but now it doesn't. And I don't see how it worked even once, since ArrayValueImpl.isNull() always returns false. This will need a different fix.
 
(0001126)
koreth
05-12-06 21:07

Okay, the real problem here is that (array)NULL is {NULL} rather than {}. The fix is to override toArray() in NullValue to return an empty ArrayValueImpl().
 
(0001129)
ferg
05-15-06 15:04

php/173e
 

- Issue History
Date Modified Username Field Change
05-12-06 20:35 koreth New Issue
05-12-06 20:47 koreth Note Added: 0001125
05-12-06 21:07 koreth Note Added: 0001126
05-15-06 15:04 ferg Note Added: 0001129
05-15-06 15:04 ferg Assigned To  => ferg
05-15-06 15:04 ferg Status new => closed
05-15-06 15:04 ferg Resolution open => fixed
05-15-06 15:04 ferg Fixed in Version  => 3.0.20


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