Source Code:
(back to article)
<?php class SomeClass { public $name = "John"; } $original_object = new SomeClass(); $copy_object = unserialize(serialize($original_object)); echo "Original object name: " . $original_object->name . "\n"; echo "Copy object name: " . $copy_object->name . "\n";
Result:
Report an issue