Re: OOP Static Functions vs. Objects

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 1, 2006 8:25 am, Edward Vermillion wrote:
> What I was mainly thinking of though, what kind of hoops does PHP
> jump through to take a class, that I assume it's holding in memory,
> and make an object out of it, aside from the constructor? Is it
> doubling the memory consumption, or more, to do that by having the
> class and an object ready to work on? Are objects stored differently
> from included classes? Or is it treating it like object references(?)
> and only making a copy when it's necessary? Or something else
> entirely?

I don't know exactly how PHP handles a static function -- whether it
has a ghost instance laying around, or cached as needed, or maybe they
just fake it with a bogus object and call settype() on it a lot.

I don't think you need to worry about having a single "extra" instance
of every class.

You generally only get into trouble when you start building factories
churning out a zillion instances of some classes.

I think you'd have to REALLY work at it and screw up Design big-time
to get enough classes that the overhead of just the class itself would
take all your RAM.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux