? real-clone.patch
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.756
diff -u -p -r1.756 common.inc
--- includes/common.inc	30 Jan 2008 23:07:41 -0000	1.756
+++ includes/common.inc	16 Feb 2008 02:37:03 -0000
@@ -1568,13 +1568,6 @@ function base_path() {
 }
 
 /**
- * Provide a substitute clone() function for PHP4.
- */
-function drupal_clone($object) {
-  return version_compare(phpversion(), '5.0') < 0 ? $object : clone($object);
-}
-
-/**
  * Add a <link> tag to the page's HEAD.
  */
 function drupal_add_link($attributes) {
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.947
diff -u -p -r1.947 node.module
--- modules/node/node.module	3 Feb 2008 19:41:47 -0000	1.947
+++ modules/node/node.module	16 Feb 2008 02:37:04 -0000
@@ -707,7 +707,7 @@ function node_load($param = array(), $re
     if ($cachable) {
       // Is the node statically cached?
       if (isset($nodes[$param])) {
-        return is_object($nodes[$param]) ? drupal_clone($nodes[$param]) : $nodes[$param];
+        return is_object($nodes[$param]) ? clone $nodes[$param] : $nodes[$param];
       }
     }
     $cond = 'n.nid = %d';
@@ -764,7 +764,7 @@ function node_load($param = array(), $re
       }
     }
     if ($cachable) {
-      $nodes[$node->nid] = is_object($node) ? drupal_clone($node) : $node;
+      $nodes[$node->nid] = is_object($node) ? clone $node : $node;
     }
   }
 
@@ -2724,7 +2724,7 @@ function node_unpublish_by_keyword_actio
  */
 function node_unpublish_by_keyword_action($node, $context) {
   foreach ($context['keywords'] as $keyword) {
-    if (strstr(node_view(drupal_clone($node)), $keyword) || strstr($node->title, $keyword)) {
+    if (strstr(node_view(clone $node), $keyword) || strstr($node->title, $keyword)) {
       $node->status = 0;
       watchdog('action', 'Set @type %title to unpublished.', array('@type' => node_get_types('name', $node), '%title' => $node->title));
       break;
Index: modules/node/node.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.pages.inc,v
retrieving revision 1.28
diff -u -p -r1.28 node.pages.inc
--- modules/node/node.pages.inc	3 Feb 2008 19:26:10 -0000	1.28
+++ modules/node/node.pages.inc	16 Feb 2008 02:37:04 -0000
@@ -394,7 +394,7 @@ function node_preview($node) {
     // Display a preview of the node.
     // Previewing alters $node so it needs to be cloned.
     if (!form_get_errors()) {
-      $cloned_node = drupal_clone($node);
+      $cloned_node = clone $node;
       $cloned_node->build_mode = NODE_BUILD_PREVIEW;
       $output = theme('node_preview', $cloned_node);
     }
@@ -432,7 +432,7 @@ function theme_node_preview($node) {
   if ($preview_trimmed_version) {
     drupal_set_message(t('The trimmed version of your post shows what your post looks like when promoted to the main page or when exported for syndication.<span class="no-js"> You can insert the delimiter "&lt;!--break--&gt;" (without the quotes) to fine-tune where your post gets split.</span>'));
     $output .= '<h3>'. t('Preview trimmed version') .'</h3>';
-    $output .= node_view(drupal_clone($node), 1, FALSE, 0);
+    $output .= node_view(clone $node, 1, FALSE, 0);
     $output .= '<h3>'. t('Preview full version') .'</h3>';
     $output .= node_view($node, 0, FALSE, 0);
   }
Index: modules/taxonomy/taxonomy.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v
retrieving revision 1.414
diff -u -p -r1.414 taxonomy.module
--- modules/taxonomy/taxonomy.module	27 Jan 2008 17:55:15 -0000	1.414
+++ modules/taxonomy/taxonomy.module	16 Feb 2008 02:37:04 -0000
@@ -838,7 +838,7 @@ function taxonomy_get_tree($vid, $parent
   if (!empty($children[$vid][$parent])) {
     foreach ($children[$vid][$parent] as $child) {
       if ($max_depth > $depth) {
-        $term = drupal_clone($terms[$vid][$child]);
+        $term = clone $terms[$vid][$child];
         $term->depth = $depth;
         // The "parent" attribute is not useful, as it would show one parent only.
         unset($term->parent);
