Mantis - Quercus
Viewing Issue Advanced Details
3184 minor always 12-16-08 20:16 12-17-08 10:01
koreth  
nam  
normal  
closed 4.0.0  
fixed  
none    
none 4.0.0  
0003184: NPE in base_convert when called with function return value
<?php
base_convert(md5('xyz'), 16, 36);

Throws an exception:

java.lang.NullPointerException
    at com.caucho.quercus.env.ObjectValue.<init>(ObjectValue.java:56)
    at com.caucho.quercus.env.JavaValue.<init>(JavaValue.java:62)
    at com.caucho.quercus.env.BigIntegerValue.<init>(BigIntegerValue.java:49)
    at com.caucho.quercus.lib.MathModule.baseToValue(MathModule.java:189)
    at com.caucho.quercus.lib.MathModule.base_convert(MathModule.java:364)

Notes
(0003663)
koreth   
12-16-08 20:20   
Ah, my title is a bit wrong. This seems to happen when you pass in a large value, nothing to do with the function call -- md5() produces the error just because its results are always big. This throws the same exception:

<?php
base_convert('a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0', 16, 36);
(0003665)
nam   
12-17-08 10:01   
php/132a