Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:26801 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2300 invoked by uid 1010); 5 Dec 2006 01:21:49 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 2285 invoked from network); 5 Dec 2006 01:21:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Dec 2006 01:21:49 -0000 Authentication-Results: pb1.pair.com header.from=info@adaniels.nl; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=info@adaniels.nl; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain adaniels.nl from 82.94.235.198 cause and error) X-PHP-List-Original-Sender: info@adaniels.nl X-Host-Fingerprint: 82.94.235.198 hyak.bean-it.nl Received: from [82.94.235.198] ([82.94.235.198:32858] helo=hyak.bean-it.nl) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7B/76-57362-989C4754 for ; Mon, 04 Dec 2006 20:21:48 -0500 Received: from [127.0.0.1] (bean-it.xs4all.nl [213.84.27.165]) (authenticated bits=0) by hyak.bean-it.nl (8.13.4/8.13.4/Debian-3sarge3) with ESMTP id kB51KxOp023899 for ; Tue, 5 Dec 2006 02:21:01 +0100 Message-ID: <4574C97F.8020507@adaniels.nl> Date: Tue, 05 Dec 2006 02:21:03 +0100 User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 To: internals@lists.php.net Content-Type: multipart/alternative; boundary="------------040102080408010307000208" X-Virus-Scanned: by amavisd-new X-Spam-Status: No, score=0.6 required=4.0 tests=BAYES_20,HTML_10_20, HTML_MESSAGE autolearn=no version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on hyak.bean-it.nl Subject: destruction of cross-referenced objects From: info@adaniels.nl (Arnold Daniels) --------------040102080408010307000208 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi, I'm struggling with the problem that cross-referenced objects don't get destroyed. I can off course write a method to break the cross-reference, but that's kind of a pain in the butt, especially if the cross-reference is not strait forward. To solve this I'm thinking of building one of 2 thing: 1.) Write a destroy() function which works much like a close function on a recourse, changing the object to a zval of type 'unknown'. 2.) Specify that a property of an object does not count for the reference count of a zval. 3.) Write code to find cross-references and destroy the objects still. The first solution should be quite easy to implement, but you need to call destroy() to free the object, introducing the whole alloc/free responsibility thing to PHP. The second solution would require some extra keyword within the class, but require no special code within the code using the object. Though I wouldn't have a clue how how to implement this or what would be the consequences. I don't think the third solution is really possible or would at least cause performance problems. I could use some comment on this problem. Or perhaps I'm just looking at it from a complete wrong angle. Thanks, Arnold PS. I don't want to start a 'cross-referencing is wrong' discussion. I use it, because it's useful in some occasions. --------------040102080408010307000208--