Mantis - Quercus
Viewing Issue Advanced Details
3271 block always 01-16-09 01:14 01-16-09 13:58
koreth  
nam  
normal  
closed 4.0.0  
fixed  
none    
none 4.0.0  
0003271: Can't call array_merge() on Java Map
<?php
import test.JavaMap;
$x = new JavaMap;
$y = $x->getMap();
array_merge($y, array());


package test;
import java.util.*;
public class JavaMap {
        public Map<String,String> getMap() {
                return new HashMap<String,String>();
        }
}


This throws an exception:

java.lang.UnsupportedOperationException
    at com.caucho.quercus.env.JavaAdapter.getHead(JavaAdapter.java:468)
    at com.caucho.quercus.lib.ArrayModule.array_merge(ArrayModule.java:2577)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.caucho.quercus.module.StaticFunction.invoke(StaticFunction.java:135)
    at com.caucho.quercus.env.JavaInvoker.callMethod(JavaInvoker.java:618)
    at com.caucho.quercus.env.JavaInvoker.call(JavaInvoker.java:553)
    at com.caucho.quercus.expr.FunctionExpr.evalImpl(FunctionExpr.java:182)
    at com.caucho.quercus.expr.FunctionExpr.eval(FunctionExpr.java:126)
    at com.caucho.quercus.statement.ExprStatement.execute(ExprStatement.java:64)

Notes
(0003747)
nam   
01-16-09 13:58   
php/0ct0