You are here

function drupal_clone in Drupal 4

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

Provide a substitute clone() function for PHP4.

Related topics

3 calls to drupal_clone()
node_load in modules/node.module
Load a node object from the database.
node_preview in modules/node.module
Generate a node preview.
theme_node_preview in modules/node.module
Display a node preview for display during node creation and editing.

File

includes/common.inc, line 1230
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;
}