Mantis - Quercus
Viewing Issue Advanced Details
2836 minor always 08-12-08 07:42 08-12-08 14:53
wikipo  
ferg  
normal  
closed 3.2.0  
fixed  
none    
none 3.2.1  
0002836: call_user_func and class method
call_user_func does not find the method to call if the syntax is:

 class_name::method_name

For example:

<?php
 $func = 'class_name::method_name';
 call_user_func($func);
?>

gives something like:

 'class_name::method_name' not found.
I have made a patch in Env.java/createCallback(), after:

    value = value.toValue();

added the following code:

    if (value instanceof StringValue)
    {
        String s = value.toString();
        String[] cm = s.split("::");
        if (cm != null && cm.length == 2)
        {
            value = new ArrayValueImpl();
            value.put(new StringBuilderValue(cm[0]));
            value.put(new StringBuilderValue(cm[1]));
        }
        
    }

Now it behaves correctly.

Notes
(0003324)
ferg   
08-12-08 14:53   
php/1c0c