Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100789 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98686 invoked from network); 27 Sep 2017 19:34:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Sep 2017 19:34:11 -0000 X-Host-Fingerprint: 95.148.131.147 unknown Received: from [95.148.131.147] ([95.148.131.147:5842] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E4/B6-34114-03DFBC95 for ; Wed, 27 Sep 2017 15:34:09 -0400 Message-ID: To: internals@lists.php.net References: Date: Wed, 27 Sep 2017 20:34:05 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:49.0) Gecko/20100101 Firefox/49.0 SeaMonkey/2.46 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Posted-By: 95.148.131.147 Subject: Re: Is reference counting necessary for a PHP implementation? From: ajf@ajf.me (Andrea Faulds) Hi there, Sidharth Kshatriya wrote: > In: > > https://github.com/php/php-langspec/blob/master/spec/04-basic-concepts.md#reclamation-and-automatic-memory-management > >> Despite the use of the term refcount, conforming implementations are not > required to use a reference counting-based implementation for automatic > memory management. > > Is this statement correct? If I understand correctly many PHP projects > depend on the deterministic firing of `__destruct()` function to cleanup > SQL transactions or connections and so forth. It's __destruct() that is the problem, yes. If “running PHP code that relies on deterministic __destruct()” is what you mean by “a PHP implementation”, then yes, it's necessary. If not, then no. :) -- Andrea Faulds https://ajf.me/