1--TEST-- 2Tests without running the constructor 3--EXTENSIONS-- 4dom 5--FILE-- 6<?php 7$rc = new ReflectionClass('DOMNode'); 8$node = $rc->newInstanceWithoutConstructor(); 9 10// Property read test 11try { 12 var_dump($node); 13} catch (Throwable $e) { 14 echo $e->getMessage(), "\n"; 15} 16 17// Call test 18try { 19 $node->removeChild($node); 20} catch (Throwable $e) { 21 echo $e->getMessage(), "\n"; 22} 23 24// Import test 25$doc = new DOMDocument; 26try { 27 $doc->appendChild($doc->importNode($node)); 28} catch (Throwable $e) { 29 echo $e->getMessage(), "\n"; 30} 31 32?> 33--EXPECT-- 34object(DOMNode)#2 (0) { 35} 36Invalid State Error 37Couldn't fetch DOMNode 38Couldn't fetch DOMNode 39