<?php

class {
    private 
$a;

    public function 
__destruct(){
        echo 
'Destructing a';
    }

    public function 
__construct(){
        echo 
'constructing a';
        
$this->a=$this;
    }

    public function 
onchange(){
        echo 
'change';
    }
}

class 
{
    private 
$funcToCall;
    public function 
__construct(){
    }
    
    public function 
setHandler($h){
        
$this->funcToCall $h;
    }
}

$a=new a();

$a=NULL//A still exists, because a contains a reference to b, which in turn contains a reference to a inside the $funcToCall property.

?>