mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
43 lines
803 B
PHP
43 lines
803 B
PHP
--TEST--
|
|
DOM classes are not serializable
|
|
--EXTENSIONS--
|
|
dom
|
|
--FILE--
|
|
<?php
|
|
|
|
$doc = new DOMDocument();
|
|
$doc->loadXML('<root><node/></root>');
|
|
try {
|
|
serialize($doc);
|
|
} catch (Exception $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
|
|
$node = $doc->documentElement;
|
|
try {
|
|
serialize($node);
|
|
} catch (Exception $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
|
|
$xpath = new DOMXPath($doc);
|
|
try {
|
|
serialize($xpath);
|
|
} catch (Exception $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
|
|
$ns = $xpath->query('//namespace::*')->item(0);
|
|
try {
|
|
serialize($ns);
|
|
} catch (Exception $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
Serialization of 'DOMDocument' is not allowed
|
|
Serialization of 'DOMElement' is not allowed
|
|
Serialization of 'DOMXPath' is not allowed
|
|
Serialization of 'DOMNameSpaceNode' is not allowed
|