Updating the object destruction database smells a bit to me as a side effect. That is, an action that occurs in an unexpected and somewhat implicit place. From looking at your code, it would not be obvious that the database action occurs on a call __destruct(), even if you call it explicitly. Future code developers (including yourself) can easily be confused by trying to track down an error related to inconsistent data, but not seeing calls to database or method calls that are similar to data interactions when viewing code.
I would advise doing this.
source
share