<?php
$orig = new stdClass();
$orig->test = 'original';
$ptr = & $orig->test; // <--- Setting an unused reference changes the behaviour
unset($ptr); // $ptr goes away and $orig->test reverts to a normal unreferenced value
$copy = clone $orig;
$copy->test = "modified";
die("Orig is: {$orig->test}"); // Gives 'modified' instead of 'original'