[pLog-svn] Some programming questions?

howard chen howachen at gmail.com
Wed Mar 5 22:14:15 EST 2008


On Thu, Mar 6, 2008 at 6:30 AM, Oscar Renalias <oscar at renalias.net> wrote:
> Are we really sure that this would save any memory?
>
>  As far as I know, PHP's garbage collector will free the memory used by
>  an object as soon as the object is out of the current execution scope.

garbage collection should come with some costs, although I didn't do
the actual testings

>  This means that if I create an object of type User via the "new"
>  operator in my own function, its memory will be freed as soon as I
>  leave my function. However, if I use a static reference to that
>  object, its memory will not be freed until the request is over.
>

This is good, so you can have internal cache, to avoid duplicated query.


Howard


More information about the pLog-svn mailing list