Mantis - Quercus
Viewing Issue Advanced Details
3158 minor always 12-12-08 09:07 12-12-08 11:23
koreth  
nam  
normal  
closed 4.0.0  
fixed  
none    
none 4.0.0  
0003158: Wrong type passed to array_slice() causes compile failure
<?php
function foo() {
  $x = array(1,2,3);
  $min_range = 0;
  $max_range = count($x) - 1;

  $middle = (int) (($min_range + $max_range) / 2);
  $larger_value = key(array_slice($x, $middle + 1, 1, true));
}

Fails to compile on the latest Resin Pro:

[09:05:23.405] {resin-12} com.caucho.java.JavaCompileException: .../_array_0slice__php.java:65: array_slice(com.caucho.quercus.env.Env,com.caucho.quercus.env.ArrayValue,long,com.caucho.quercus.env.Value,boolean) in com.caucho.quercus.lib.ArrayModule cannot be applied to (com.caucho.quercus.env.Env,com.caucho.quercus.env.ArrayValue,double,com.caucho.quercus.env.Value,boolean)
[09:05:23.405] {resin-12} v_larger_value = ArrayModule.key(_quercus_module_3.array_slice(env, v_x.toValue().toArrayValue(env), ((double) v_middle + 1L), qv_1_0, true));

Notes
(0003610)
nam   
12-12-08 11:23   
php/3aap