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;
	}
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;
	}
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 ; }
Replaces a child node
@param Node $what
@param mixed $with Node or an array of Node
@return bool
Replaces a child node