Re: PHP Object-Caching and Reference Counting

From: Date: Sun, 21 Jan 2007 16:15:00 +0000
Subject: Re: PHP Object-Caching and Reference Counting
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-27562@lists.php.net to get a copy of this message
Perhaps you could use your own reference counting? Keep your "real" objects in private array and instead of returning them return a simple object which would forward all methods and properties by __get/__set/__call. The constructor would increase your internal refcount by one, destructor would decrease it. I use those objects quite often as they are used to access the database to manipulate or search for related data. It wouldn't perform well and is actually not at all practicable because there are so many classes for which I'd would have to copy the interface.


« previous php.internals (#27562) next »