callback = $callback; } function __destruct() { call_user_func( $this->callback ); } }