Mantis - Quercus
Viewing Issue Advanced Details
4318 minor always 12-07-10 13:00 12-07-10 17:53
ferg  
ferg  
normal  
closed 4.0.14  
fixed  
none    
none 4.0.14  
0004318: SimpleXMLElement count
(rep by Homayoun Zariv)

We are running into another issue with Quercus. We have a SimpleXMLElement object ($cathist->categoryHistogram see var_dump below) and when we invoke the count function (see below statements) it returns only 1. On a pure PHP count function returns the count of elements in the xml. By the way when we switched to using foreach instead of getting the count and for loop then Quercus is working. I would like to ask why the count function is not working as expected in Quercus?

$len = count($cathist->categoryHistogram);
for ($i = 0; $i < $len; $i++) {
    $cat = $cathist->categoryHistogram[$i];
    .....
}

Var_dump for ($cathist->categoryHistogram)

Notes
(0004866)
ferg   
12-07-10 17:53   
php/1x28