/**
 * Affect null to the unused objects
 * @param unknown_type $object
 */
function clear_object_parser(&$object)
{
    if (is_object($object)) {
        foreach (array_keys((array) $object) as $key) {
            clear_object_parser($property);
        }
        foreach (get_class_vars(get_class($object)) as $property => $value) {
            clear_object_parser($property);
        }
    }
    $object = null;
    unset($object);
}
 /**
  * Class destructor
  */
 function __destruct()
 {
     clear_object_parser($this);
 }