<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.domchildnode.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'domchildnode.replacewith.php',
    1 => 'DOMChildNode::replaceWith',
    2 => 'Replaces the node with new nodes',
  ),
  'up' => 
  array (
    0 => 'class.domchildnode.php',
    1 => 'DOMChildNode',
  ),
  'prev' => 
  array (
    0 => 'domchildnode.remove.php',
    1 => 'DOMChildNode::remove',
  ),
  'next' => 
  array (
    0 => 'class.domcomment.php',
    1 => 'DOMComment',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/dom/domchildnode/replacewith.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="domchildnode.replacewith" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">DOMChildNode::replaceWith</h1>
  <p class="verinfo">(PHP 8)</p><p class="refpurpose"><span class="refname">DOMChildNode::replaceWith</span> &mdash; <span class="dc-title">Replaces the node with new nodes</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-domchildnode.replacewith-description">
  <h3 class="title">Descrizione</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>DOMChildNode::replaceWith</strong></span>(<span class="methodparam"><span class="type"><span class="type"><a href="class.domnode.php" class="type DOMNode">DOMNode</a></span>|<span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">...$nodes</code></span>): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>

  <p class="para rdfs-comment">
   Replaces the node with new <code class="parameter">nodes</code>.
  </p>
 </div>

 
 <div class="refsect1 parameters" id="refsect1-domchildnode.replacewith-parameters">
  <h3 class="title">Elenco dei parametri</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">nodes</code></dt>
     <dd>
      <p class="para">
       The replacement nodes.
       Strings are automatically converted to text nodes.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>

 
 <div class="refsect1 returnvalues" id="refsect1-domchildnode.replacewith-returnvalues">
  <h3 class="title">Valori restituiti</h3>
  <p class="para">
   Nessun valore viene restituito.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-domchildnode.replacewith-errors">
  <h3 class="title">Errori/Eccezioni</h3>
  <dl>
   
 <dt><strong><code><a href="dom.constants.php#constant.dom-hierarchy-request-err">DOM_HIERARCHY_REQUEST_ERR</a></code></strong></dt>
  <dd>
  <p class="para">
    Raised if the parent is of a type that does not allow children of the
    type of one of the passed <code class="parameter">nodes</code>, or if the node to
    put in is one of this node&#039;s ancestors or this node itself.
  </p>
 </dd>

   
 <dt><strong><code><a href="dom.constants.php#constant.dom-wrong-document-err">DOM_WRONG_DOCUMENT_ERR</a></code></strong></dt>
  <dd>
  <p class="para">
    Raised if one of the passed <code class="parameter">nodes</code> was created from a different
    document than the one that created this node.
  </p>
 </dd>

  </dl>
 </div>


 <div class="refsect1 changelog" id="refsect1-domchildnode.replacewith-changelog">
  <h3 class="title">Log delle modifiche</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Versione</th>
      <th>Descrizione</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.3.0</td>
      <td>
       Calling this method on a node without a parent is now a no-op to align the behaviour with the DOM specification.
       Previously this threw a
 <span class="classname"><a href="class.domexception.php" class="classname">DOMException</a></span> with code
 <strong><code><a href="dom.constants.php#constant.dom-hierarchy-request-err">DOM_HIERARCHY_REQUEST_ERR</a></code></strong>.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-domchildnode.replacewith-seealso">
  <h3 class="title">Vedere anche:</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="methodname"><a href="domchildnode.after.php" class="methodname" rel="rdfs-seeAlso">DOMChildNode::after()</a> - Adds nodes after the node</span></li>
    <li><span class="methodname"><a href="domchildnode.before.php" class="methodname" rel="rdfs-seeAlso">DOMChildNode::before()</a> - Adds nodes before the node</span></li>
    <li><span class="methodname"><a href="domchildnode.remove.php" class="methodname" rel="rdfs-seeAlso">DOMChildNode::remove()</a> - Removes the node</span></li>
    <li><span class="methodname"><a href="domnode.replacechild.php" class="methodname" rel="rdfs-seeAlso">DOMNode::replaceChild()</a> - Replaces a child</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>