diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index dc569b1647..9ee661f742 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -3775,9 +3775,11 @@ function _drupal_shutdown_function() {
   // was in the normal context of execution.
   chdir(DRUPAL_ROOT);
 
+  reset($callbacks);
   try {
-    while (list($key, $callback) = each($callbacks)) {
+    while ($callback = current($callbacks)) {
       call_user_func_array($callback['callback'], $callback['arguments']);
+      next($callbacks);
     }
   }
   catch (Exception $exception) {
diff --git a/includes/install.inc b/includes/install.inc
index 5e1d3c6326..b7db783586 100644
--- a/includes/install.inc
+++ b/includes/install.inc
@@ -779,7 +779,7 @@ function drupal_uninstall_modules($module_list = array(), $uninstall_dependents
     $module_list = array_flip(array_values($module_list));
 
     $profile = drupal_get_profile();
-    while (list($module) = each($module_list)) {
+    foreach (array_keys($module_list) as $module) {
       if (!isset($module_data[$module]) || drupal_get_installed_schema_version($module) == SCHEMA_UNINSTALLED) {
         // This module doesn't exist or is already uninstalled. Skip it.
         unset($module_list[$module]);
diff --git a/includes/menu.inc b/includes/menu.inc
index 4664d27e89..9bee2216c7 100644
--- a/includes/menu.inc
+++ b/includes/menu.inc
@@ -576,7 +576,8 @@ function _menu_load_objects(&$item, &$map) {
           // 'load arguments' in the hook_menu() entry, but they need
           // some processing. In this case the $function is the key to the
           // load_function array, and the value is the list of arguments.
-          list($function, $args) = each($function);
+          $args = current($function);
+          $function = key($function);
           $load_functions[$index] = $function;
 
           // Some arguments are placeholders for dynamic items to process.
@@ -2402,7 +2403,7 @@ function menu_set_active_trail($new_trail = NULL) {
       // a stripped down menu tree containing the active trail only, in case
       // the given menu has not been built in this request yet.
       $tree = menu_tree_page_data($preferred_link['menu_name'], NULL, TRUE);
-      list($key, $curr) = each($tree);
+      $curr = current($tree);
     }
     // There is no link for the current path.
     else {
@@ -2432,7 +2433,8 @@ function menu_set_active_trail($new_trail = NULL) {
         }
         $tree = $curr['below'] ? $curr['below'] : array();
       }
-      list($key, $curr) = each($tree);
+      $curr = current($tree);
+      next($tree);
     }
     // Make sure the current page is in the trail to build the page title, by
     // appending either the preferred link or the menu router item for the
diff --git a/includes/module.inc b/includes/module.inc
index 2e251080b7..f8e229dd78 100644
--- a/includes/module.inc
+++ b/includes/module.inc
@@ -404,7 +404,7 @@ function module_enable($module_list, $enable_dependencies = TRUE) {
     // Create an associative array with weights as values.
     $module_list = array_flip(array_values($module_list));
 
-    while (list($module) = each($module_list)) {
+    while ($module = key($module_list)) {
       if (!isset($module_data[$module])) {
         // This module is not found in the filesystem, abort.
         return FALSE;
@@ -423,6 +423,8 @@ function module_enable($module_list, $enable_dependencies = TRUE) {
           $module_list[$dependency] = 0;
         }
       }
+
+      next($module_list);
     }
 
     if (!$module_list) {
@@ -540,7 +542,7 @@ function module_disable($module_list, $disable_dependents = TRUE) {
     $module_list = array_flip(array_values($module_list));
 
     $profile = drupal_get_profile();
-    while (list($module) = each($module_list)) {
+    while ($module = key($module_list)) {
       if (!isset($module_data[$module]) || !$module_data[$module]->status) {
         // This module doesn't exist or is already disabled, skip it.
         unset($module_list[$module]);
@@ -555,6 +557,8 @@ function module_disable($module_list, $disable_dependents = TRUE) {
           $module_list[$dependent] = 0;
         }
       }
+
+      next($module_list);
     }
 
     // Sort the module list by pre-calculated weights.
