Re: New destructors implementation
| From: | Zeev Suraski | Date: | Thu, 05 Feb 2004 23:48:33 +0000 |
| Subject: | Re: New destructors implementation | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-7621@lists.php.net to get a copy of this message | ||
At 23:16 05/02/2004, Andrei Zmievski wrote:
On Thu, 05 Feb 2004, Zeev Suraski wrote: Internal objects as in the ones in reflection and similar? Yes. But I'd imagine that for most other objects which completely overload the behavior, you wouldn't need that. Generally, if your object should be able to call __destruct() *AND* it's a PHP-style object (has the same structure), it should use that callback, otherwise - not. Be advised that your __destruct() mustn't actually render the object unusuable to the degree that PHP would crash if it touches it. It *may* be referenced after __destruct() is called (it would be an error on the author's part to do that, but nothing will prevent him from doing that). So you are saying I can delegate calling __destruct() to Zend and then worry only about freeing storage in my objects?Yeah, assuming they're PHP-style objects (zend_object structure) then yes, it should work fine. Zeev