=== modified file 'includes/bootstrap.inc'
--- includes/bootstrap.inc	2007-08-28 11:42:56 +0000
+++ includes/bootstrap.inc	2007-08-30 06:23:20 +0000
@@ -324,7 +324,7 @@ function conf_init() {
     $cookie_domain = substr($cookie_domain, 4);
   }
   $cookie_domain = explode(':', $cookie_domain);
-  $cookie_domain = '.'. array_shift($cookie_domain);
+  $cookie_domain = '.'. $cookie_domain[0];
   // Per RFC 2109, cookie domains must contain at least one dot other than the
   // first. For hosts such as 'localhost' or IP Addresses we don't set a cookie domain.
   if (count(explode('.', $cookie_domain)) > 2 && !is_numeric(str_replace('.', '', $cookie_domain))) {
@@ -862,15 +862,18 @@ function drupal_anonymous_user($session 
  *     DRUPAL_BOOTSTRAP_FULL: Drupal is fully loaded, validate and fix input data.
  */
 function drupal_bootstrap($phase) {
-  static $phases = array(DRUPAL_BOOTSTRAP_CONFIGURATION, DRUPAL_BOOTSTRAP_EARLY_PAGE_CACHE, DRUPAL_BOOTSTRAP_DATABASE, DRUPAL_BOOTSTRAP_ACCESS, DRUPAL_BOOTSTRAP_SESSION, DRUPAL_BOOTSTRAP_LATE_PAGE_CACHE, DRUPAL_BOOTSTRAP_LANGUAGE, DRUPAL_BOOTSTRAP_PATH, DRUPAL_BOOTSTRAP_FULL);
+  static $phases = array(DRUPAL_BOOTSTRAP_CONFIGURATION, DRUPAL_BOOTSTRAP_EARLY_PAGE_CACHE, DRUPAL_BOOTSTRAP_DATABASE, DRUPAL_BOOTSTRAP_ACCESS, DRUPAL_BOOTSTRAP_SESSION, DRUPAL_BOOTSTRAP_LATE_PAGE_CACHE, DRUPAL_BOOTSTRAP_LANGUAGE, DRUPAL_BOOTSTRAP_PATH, DRUPAL_BOOTSTRAP_FULL), $phase_index = 0;
 
   // Stop early if $phase was already executed.
-  if (!in_array($phase, $phases)) {
+  if ($phase < $phase_index) {
     return;
   }
 
-  while (!is_null($current_phase = array_shift($phases))) {
+  while (!empty($phases)) {
+    $current_phase = $phases[$phase_index];
+    unset($phases[$phase_index]);
     _drupal_bootstrap($current_phase);
+    $phase_index++;
     if ($phase == $current_phase) {
       return;
     }

=== modified file 'includes/module.inc'
--- includes/module.inc	2007-08-22 08:36:34 +0000
+++ includes/module.inc	2007-08-30 06:21:41 +0000
@@ -380,8 +380,9 @@ function module_implements($hook, $sort 
  */
 function module_invoke() {
   $args = func_get_args();
-  $module = array_shift($args);
-  $hook = array_shift($args);
+  $module = $args[0];
+  $hook = $args[1];
+  unset($args[0], $args[1]);
   $function = $module .'_'. $hook;
   if (module_hook($module, $hook)) {
     return call_user_func_array($function, $args);
@@ -400,7 +401,8 @@ function module_invoke() {
  */
 function module_invoke_all() {
   $args = func_get_args();
-  $hook = array_shift($args);
+  $hook = $args[0];
+  unset($args[0]);
   $return = array();
   foreach (module_implements($hook) as $module) {
     $function = $module .'_'. $hook;

