1--TEST--
2DOM classes are not unserializable
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7
8$classes = [
9    "DOMXPath",
10    "DOMDocument",
11    "DOMNode",
12    "DOMNameSpaceNode",
13];
14
15foreach ($classes as $class)
16{
17    try {
18        unserialize('O:' . strlen($class) . ':"' . $class . '":0:{}');
19    } catch (Exception $e) {
20        echo $e->getMessage(), "\n";
21    }
22}
23
24?>
25--EXPECT--
26Unserialization of 'DOMXPath' is not allowed
27Unserialization of 'DOMDocument' is not allowed, unless unserialization methods are implemented in a subclass
28Unserialization of 'DOMNode' is not allowed, unless unserialization methods are implemented in a subclass
29Unserialization of 'DOMNameSpaceNode' is not allowed, unless unserialization methods are implemented in a subclass
30