original_string: public function remove_child(custom_menu_item $menuitem) {
          $removed = false;
          if (($key = array_search($menuitem, $this->children)) !== false) {
              unset($this->children[$key]);
              $this->children = array_values($this->children);
              $removed = true;
          } else {
              foreach ($this->children as $child) {
                  if ($removed = $child->remove_child($menuitem)) {
                      break;
                  }
              }
          }
          return $removed;
      }
code: public function remove_child(custom_menu_item $menuitem) {
          $removed = false;
          if (($key = array_search($menuitem, $this->children)) !== false) {
              unset($this->children[$key]);
              $this->children = array_values($this->children);
              $removed = true;
          } else {
              foreach ($this->children as $child) {
                  if ($removed = $child->remove_child($menuitem)) {
                      break;
                  }
              }
          }
          return $removed;
      }
code_tokens: public function remove_child ( custom_menu_item $ menuitem ) { $ removed = false ; if ( ( $ key = array_search ( $ menuitem , $ this -> children ) ) !== false ) { unset ( $ this -> children [ $ key ] ) ; $ this -> children = array_values ( $ this -> children ) ; $ removed = true ; } else { foreach ( $ this -> children as $ child ) { if ( $ removed = $ child -> remove_child ( $ menuitem ) ) { break ; } } } return $ removed ; }
docstring: Removes a custom menu item that is a child or descendant to the current menu.
  
  Returns true if child was found and removed.
  
  @param custom_menu_item $menuitem
  @return bool
docstring_tokens: Removes a custom menu item that is a child or descendant to the current menu .