Download src/php/php-src/ext/simplexml/tests/SimpleXMLElement_xpath.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 566 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/simplexml/tests/SimpleXMLElement_xpath.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/simplexml/tests/SimpleXMLElement_xpath.phpt
-
curl -L -o SimpleXMLElement_xpath.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/simplexml/tests/SimpleXMLElement_xpath.phpt
566 Bytes
| --TEST-- | |
| Testing xpath() with invalid XML | |
| --EXTENSIONS-- | |
| simplexml | |
| --FILE-- | |
| // 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 | |