Same name and namespace in other branches
  1. 4.7.x includes/common.inc \drupal_clone()
  2. 6.x includes/common.inc \drupal_clone()

Provide a substitute clone() function for PHP4.

Related topics

4 calls to drupal_clone()
node_load in modules/node/node.module
Load a node object from the database.
node_preview in modules/node/node.module
Generate a node preview.
taxonomy_get_tree in modules/taxonomy/taxonomy.module
Create a hierarchical representation of a vocabulary.
theme_node_preview in modules/node/node.module
Display a node preview for display during node creation and editing.

File

includes/common.inc, line 1528
Common functions that many Drupal modules will need to reference.

Code

function drupal_clone($object) {
  return version_compare(phpversion(), '5.0') < 0 ? $object : clone $object;
}