--TEST-- compareDocumentPosition: contains attribute as a direct descendent --EXTENSIONS-- dom --FILE-- loadXML(<< XML); $container = $dom->documentElement; $attribute = $container->attributes[0]; var_dump($container->compareDocumentPosition($attribute) === (DOMNode::DOCUMENT_POSITION_FOLLOWING | DOMNode::DOCUMENT_POSITION_CONTAINED_BY)); var_dump($attribute->compareDocumentPosition($container) === (DOMNode::DOCUMENT_POSITION_PRECEDING | DOMNode::DOCUMENT_POSITION_CONTAINS)); ?> --EXPECT-- bool(true) bool(true)