Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:18706 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60114 invoked by uid 1010); 8 Sep 2005 08:59:44 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 60099 invoked from network); 8 Sep 2005 08:59:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Sep 2005 08:59:44 -0000 X-Host-Fingerprint: 80.74.107.235 mail.zend.com Linux 2.5 (sometimes 2.4) (4) Received: from ([80.74.107.235:34872] helo=mail.zend.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 04/C8-23233-E7DFF134 for ; Thu, 08 Sep 2005 04:59:43 -0400 Received: (qmail 32197 invoked from network); 8 Sep 2005 08:59:38 -0000 Received: from shire.zend.office (10.1.2.160) by internal.zend.office with SMTP; 8 Sep 2005 08:59:38 -0000 Date: Thu, 8 Sep 2005 11:59:38 +0300 (IDT) X-X-Sender: frodo@shire.zend.office To: Sara Golemon cc: internals@lists.php.net In-Reply-To: <002301c5b40d$0f75a570$85901a44@lighthammer> Message-ID: References: <002301c5b40d$0f75a570$85901a44@lighthammer> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] zend_list_delete() doesn't. From: stas@zend.com (Stanislav Malyshev) SG>>> $fp1 = fopen('test', 'w'); SG>> $fp2 = $fp1; /* Still a single zval* and le->refcount == 1 */ SG>> $fp3 = &$fp1; /* Two zval*s now and le->refcount == 2 */ SG>> SG>> fclose($fp1); I think this was discussed before, though I may be mistaken. The problem here is that you expect fclose to kill the resource, however $fp2 still refers it. Looks like there should be two operations for resource - one is usual delref called when variable is destroyed and second is "hard kill" called when something like fclose is used and invalidating all referring variables. I remember there were some issues with that, but I can't rememebr what they were... -- Stanislav Malyshev, Zend Products Engineer stas@zend.com http://www.zend.com/ +972-3-6139665 ext.115