bug48601.phpt 363 B

1234567891011121314151617181920
  1. --TEST--
  2. Bug #48601 (xpath() returns FALSE for legitimate query)
  3. --EXTENSIONS--
  4. simplexml
  5. --FILE--
  6. <?php
  7. $sxe = simplexml_load_string('<root><node1>1</node1></root>');
  8. $nodes = $sxe->xpath("/root/node2/@test");
  9. if (! is_array($nodes)) {
  10. echo "An error occurred\n";
  11. } else {
  12. echo "Result Count: " . count($nodes) . "\n";
  13. }
  14. ?>
  15. --EXPECT--
  16. Result Count: 0