original_string: public function replace_child(Node $what, $with)
  	{
  		$replace_key = array_search($what, $this->children);
  
  		if($replace_key === false)
  			return false;
  
  		if(is_array($with))
  			foreach($with as $child)
  				$child->set_parent($this);
  
  		array_splice($this->children, $replace_key, 1, $with);
  
  		return true;
  	}
code: public function replace_child(Node $what, $with)
  	{
  		$replace_key = array_search($what, $this->children);
  
  		if($replace_key === false)
  			return false;
  
  		if(is_array($with))
  			foreach($with as $child)
  				$child->set_parent($this);
  
  		array_splice($this->children, $replace_key, 1, $with);
  
  		return true;
  	}
code_tokens: public function replace_child ( Node $ what , $ with ) { $ replace_key = array_search ( $ what , $ this -> children ) ; if ( $ replace_key === false ) return false ; if ( is_array ( $ with ) ) foreach ( $ with as $ child ) $ child -> set_parent ( $ this ) ; array_splice ( $ this -> children , $ replace_key , 1 , $ with ) ; return true ; }
docstring: Replaces a child node
  @param Node $what
  @param mixed $with Node or an array of Node
  @return bool
docstring_tokens: Replaces a child node