Leonardo Pedretti wrote:
It would not be such a problem to write something that does the same task through a static or global function, but unfortunately it is impossible, due to the following: you can build a cache in an array, then in a __new() function you could check if the requested object is already loaded and return a reference. However, if this is the case, objects that enter the cache never leave it because they are still referenced in the array when all other references have gone, so they never destruct, except when the array is destroyed at program's end.

PHP5 has destructors ...

regards,
Lukas

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to