php-src/ext/dom/tests/DOMXPath_clone.phpt
Niels Dossche 85217a044a Mark DOMXPath as uncloneable
This never resulted in a working XPath object anyway, as trying to query
or evaluate anything resulted in an "Invalid XPath context" error.
Supporting this is more trouble than it's worth, so just block the clone
operation.
2024-02-23 19:35:38 +01:00

22 lines
365 B
PHP

--TEST--
DOMXPath: Cloning a DOMXPath object
--EXTENSIONS--
dom
--SKIPIF--
<?php
if (!class_exists('DOMXPath')) die('skip no xpath support');
?>
--FILE--
<?php
$dom = new DOMDocument;
$xpath = new DOMXPath($dom);
try {
clone $xpath;
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
Trying to clone an uncloneable object of class DOMXPath