(PHP 8 >= 8.3.0)
DOMNode::contains — Vérifie si un nœud contient un autre nœud
   Vérifie si le nœud contient l'autre nœud other.
  
otherLe nœud à vérifier.
Exemple #1 Exemple de DOMNode::contains()
<?php
$dom = new DOMDocument();
$dom->loadXML(<<<XML
<!DOCTYPE HTML>
<html>
   <body>
       <main>
           <p>Hello, world!</p>
       </main>
   </body>
</html>
XML);
$xpath = new DOMXPath($dom);
$main = $xpath->query("//main")[0];
var_dump($dom->documentElement->contains($main));
?>L'exemple ci-dessus va afficher :
bool(true)
