original_string: protected function _remove_node(DOMNode $node, array &$children, $index)
      {
          $child = $children[$index];
          $previousChild = $child->previousSibling;
          $nextChild = $child->nextSibling;
          $node->removeChild($child);
          if (isset($previousChild, $nextChild)) {
              if ($previousChild->nodeName === "#text" && $nextChild->nodeName === "#text") {
                  $previousChild->nodeValue .= $nextChild->nodeValue;
                  $this->_remove_node($node, $children, $index+1);
              }
          }
          array_splice($children, $index, 1);
      }
code: protected function _remove_node(DOMNode $node, array &$children, $index)
      {
          $child = $children[$index];
          $previousChild = $child->previousSibling;
          $nextChild = $child->nextSibling;
          $node->removeChild($child);
          if (isset($previousChild, $nextChild)) {
              if ($previousChild->nodeName === "#text" && $nextChild->nodeName === "#text") {
                  $previousChild->nodeValue .= $nextChild->nodeValue;
                  $this->_remove_node($node, $children, $index+1);
              }
          }
          array_splice($children, $index, 1);
      }
code_tokens: protected function _remove_node ( DOMNode $ node , array & $ children , $ index ) { $ child = $ children [ $ index ] ; $ previousChild = $ child -> previousSibling ; $ nextChild = $ child -> nextSibling ; $ node -> removeChild ( $ child ) ; if ( isset ( $ previousChild , $ nextChild ) ) { if ( $ previousChild -> nodeName === "#text" && $ nextChild -> nodeName === "#text" ) { $ previousChild -> nodeValue .= $ nextChild -> nodeValue ; $ this -> _remove_node ( $ node , $ children , $ index + 1 ) ; } } array_splice ( $ children , $ index , 1 ) ; }
docstring: Remove a child from a node
  
  Remove a child from a node. If the removed node results in two
  adjacent #text nodes then combine them.
  
  @param DOMNode $node the current DOMNode being considered
  @param array $children an array of nodes that are the children of $node
  @param int $index index from the $children array of the node to remove
docstring_tokens: Remove a child from a node