Is using php destructor appropriate for displaying HTML?
问题 If a class is implemented that builds HTML for a page by constructing it and calling various methods, is it appropriate to define the display/echo part of the class within the destructor? Instead of having a explicit Class:displayHTML(); method, having the echo $this->html in the destructor and whenever you are ready to display call unset($object); which would display it? I know the destructor probably is not the best place for this but wonder what others thoughts are on this? 回答1: That