```
$fooinstance = new foo();
/*do something*/
exit('bar');

class foo{
  __destruct(){
    //get the exit message ("bar") to do something with it
  }
}

```

Hello,

I would like to get the exit message to do something with it (for example insert the exit status in a database). Is there a way to do that ?

Thanks