I have an objet that I would like to reset when an exception is thrown, is there any way to do this?

For example I have this class:

```
class TestClass{

    public $value = 0;

}

```

I then create an instance of the class and set it's `$value` to 100 in the `try`, then throw an error like this:

```
$test = new TestClass();

try{
    $test->value = 100;
    throw new Exception("Error!", 100);
}catch(Exception $ex){
    var_dump($test);
}

```

The `var_dump` will be be called since an error is throw, but when the dump displays, `$value` is still `100` I was hoping that it would still be `0` for this test, but it is not. Is there a way to reset the instance when an error is thrown?