Same name and namespace in other branches
- 4.7.x includes/common.inc \drupal_clone()
- 5.x includes/common.inc \drupal_clone()
Provide a substitute clone() function for PHP4.
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.pages.inc - Generate a node preview.
- theme_node_preview in modules/
node/ node.pages.inc - Display a node preview for display during node creation and editing.
- _system_theme_data in modules/
system/ system.module - Helper function to scan and collect theme .info data and their engines.
File
- includes/
common.inc, line 1805 - 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;
}