Mantis - Quercus
Viewing Issue Advanced Details
5221 major always 09-20-12 06:34 09-20-12 06:34
jamnikr  
 
normal  
new 4.0.31  
open  
none    
none  
0005221: SimpleXMLElement count return always 0
I use Tomcat 7 and Quercus 4.0.31.
I was trying using XML obejct which is transformate in PHP to SimpleXMLElement. When I use method count on this object I get a wrong response.

Simple test from PHP.net


<?php
$xml = '<example xmlns:foo="my.foo.urn">
  <foo:a>Apple</foo:a>
  <foo:b>Banana</foo:b>
  <c>Cherry</c>
</example>';

$sxe = new SimpleXMLElement($xml);

$kids = $sxe->children('foo');
var_dump(count($kids));

$kids = $sxe->children('foo', TRUE);
var_dump(count($kids));

$kids = $sxe->children('my.foo.urn');
var_dump(count($kids));

$kids = $sxe->children('my.foo.urn', TRUE);
var_dump(count($kids));

$kids = $sxe->children();
var_dump(count($kids));
?>


right should be:
int(0)
int(2)
int(2)
int(0)
int(1)

but now is

int(0)
int(0)
int(0)
int(0)
int(0)

There are no notes attached to this issue.