Logging global PHP objects and saving memory using a lazy loading proxy
blog.simonholywell.com
Quite often when you are working with legacy code you will come across a mess of globals. Every single method will make use of the same global instance of the database class for example. So where do you begin to work with this massive impediment?