mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00

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.
22 lines
365 B
PHP
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
|