SimpleXMLElement_xpath.phpt 542 B

1234567891011121314151617
  1. --TEST--
  2. Testing xpath() with invalid XML
  3. --SKIPIF--
  4. <?php if (!extension_loaded('simplexml')) die('skip simplexml extension not loaded'); ?>
  5. --FILE--
  6. <?php
  7. // gracefully recover from parsing of invalid XML; not available in PHP
  8. const XML_PARSE_RECOVER = 1;
  9. // we're not interested in checking concrete warnings regarding invalid XML
  10. $xml = @simplexml_load_string("XXXXXXX^", 'SimpleXMLElement', XML_PARSE_RECOVER);
  11. // $xml is supposed to hold a SimpleXMLElement, but not FALSE/NULL
  12. var_dump($xml->xpath("BBBB"));
  13. ?>
  14. --EXPECT--
  15. bool(false)