1--TEST-- 2Testing 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 8const XML_PARSE_RECOVER = 1; 9 10// we're not interested in checking concrete warnings regarding invalid XML 11$xml = @simplexml_load_string("XXXXXXX^", 'SimpleXMLElement', XML_PARSE_RECOVER); 12 13// $xml is supposed to hold a SimpleXMLElement, but not FALSE/NULL 14var_dump($xml->xpath("BBBB")); 15?> 16--EXPECT-- 17bool(false) 18