php-src/ext/simplexml/tests/SimpleXMLElement_xpath.phpt
Max Semenik 7f2f0c007c Migrate skip checks to --EXTENSIONS--, p4
For rationale, see #6787

Extensions migrated in part 4:
* simplexml
* skeleton
* soap
* spl
* sqlite3
* sysvmsg
* sysvsem
* tidy - also removed a check for an ancient dependency version
2021-04-08 10:36:44 +02:00

21 lines
566 B
PHP

--TEST--
Testing xpath() with invalid XML
--EXTENSIONS--
simplexml
--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
try {
var_dump($xml->xpath("BBBB"));
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
SimpleXMLElement is not properly initialized