Güzel cevap Mark, ama ben bu işe nasıl emin değilim:
First Diagram:
<?php
$obj = "foo";
$a = $obj;
$b = $obj;
$c = $obj;
$c = NULL;
unset( $c );
var_dump( $a, $b, $c );
Results:
string(3) "foo"
string(3) "foo"
NULL
Second Diagram:
<?php
$obj = "foo";
$wrapper =& $obj;
$a = $wrapper;
$b = $wrapper;
$c = $wrapper;
$c = NULL;
unset( $c );
var_dump( $a, $b, $c );
Results:
string(3) "foo"
string(3) "foo"
NULL
Correct Way:
<?php
$obj = "foo";
$a =& $obj;
$b =& $obj;
$c =& $obj;
$c = NULL;
var_dump( $a, $b, $c );
Results:
NULL
NULL
NULL
Explanation:
You need to reference your variables
$a,$b,$c to the memory address of
$obj, this way when you set $c to
NULL, this will set the actual memory address
to NULL instead of just the reference.