Deepcopy: Difference between revisions
Content added Content deleted
No edit summary |
|||
Line 422: | Line 422: | ||
: (== A B) |
: (== A B) |
||
-> NIL # but they are not identical (pointer-equal)</lang> |
-> NIL # but they are not identical (pointer-equal)</lang> |
||
=={{Header|PHP}}== |
|||
<lang PHP><?php |
|||
// Empty object |
|||
class object{} |
|||
$object = new object; |
|||
$object->some_value = 1; |
|||
$deepcopy = clone $object; |
|||
$deepcopy->some_value++; |
|||
echo "Object contains {$object->some_value}\n", |
|||
"Clone of object contains {$deepcopy->some_value}\n";</lang> |
|||
Documentation: [http://www.php.net/manual/en/language.oop5.cloning.php http://www.php.net/manual/en/language.oop5.cloning.php] |
|||
=={{header|Python}}== |
=={{header|Python}}== |