I think this should be implemented by user. If you are full OOP in your
application, then just register all your objects in some global object (In
my case I have a global singelton) and trigger hiv removal at the end of
your application. If you have destructors written in every object - they
will be destroied by chain correctly. Yes, this is design featchure, but a
good one, because if you will move beyound PHP you will have to learn how to
do it anyway sooner or laiter :)
User knows the best how his objects should be destroied. PHP is slow
enougth, any special functionality will make it more slow. Let's let
developers do the optimization work for a while, may be they will find a way
how to significantly boost PHP speed :)