Destructors ?
| From: | clayton collie | Date: | Tue, 13 Jun 2000 15:02:54 +0000 |
| Subject: | Destructors ? | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-21209@lists.php.net to get a copy of this message | ||
are we planning the introduction of class destructors for PHP ? Reference
counting & scoping handles the majority of issues, but there are other cases
where explicit destructors would be useful. This seems most useful for
classes which hold references to others with different lifetimes.
Lets say i create a resource pool class, which dishes out instances of a
given class C on demand. Lets say that in the course of processing, C gets
FUBARed, or legitimately is no longer needed (e.g. number of pool requests
much lower than items in pool), C could conveniently in its destructor tell
the pool to remove it before C commits suicide.
can this all be done using the resource mechanism (in "c" - the
language). what would be the analogue in PHP ?
clayton collie