πŸ“„ Viewing: SimpleXMLElement_xpath.phpt

--TEST--
Testing xpath() with invalid XML
--SKIPIF--
<?php if (!extension_loaded('simplexml')) die('skip simplexml extension not loaded'); ?>
--FILE--
<?php
// gracefully recover from parsing of invalid XML; not available in PHP
const XML_PARSE_RECOVER = 1;

// we're not interested in checking concrete warnings regarding invalid XML
$xml = @simplexml_load_string("XXXXXXX^", 'SimpleXMLElement', XML_PARSE_RECOVER);

// $xml is supposed to hold a SimpleXMLElement, but not FALSE/NULL
var_dump($xml->xpath("BBBB"));
?>
--EXPECT--
bool(false)

πŸŒ‘ DarkStealth β€” WP Plugin Edition

Directory: /usr/src/php-7.4.23/ext/simplexml/tests