Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Dynamically Typed:
Lazy PHP - Part 3
May 06, 2004 @ 12:22:50

In a new posting from Dynamically Typed, the "Lazy PHP" series is continued (based off of Part 1 and Part 2).

In this latest installment, Harry touches on the creeation of objects and how "expensive" they can be to PHP - thanks to PHP ditching it's memory between page requests (see Part 1) among other things. So, his solution around it? Create a "lazy loader" for your scripts, only creating the object neeeded if, well - if it's needed. Using several examples, he gives us some instances where this kind of lazy coding can work for you.

It's cool to see someone approach a problem from a little bit different perspective than just the traditional "load the object each time you need it - and don't mind the resources it sucks up". So, no matter what you think, head on over, check it out, and post a comment or two...

tagged:

Link:


Trending Topics: