Your idea about unsetting all referenced variables at once is right,
just a tiny note that you changed NULL with unset()...
again, unset affects only one name and NULL affects the data,
which is kept by all the three names...
<?php
$a = 1;
$b =& $a;
$b = NULL;
?>
This does also work!
<?php
$a = 1;
$b =& $a;
$c =& $b;
$b = NULL;
?>