SimpleXMLElement_xpath.phpt 444 B

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