Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:8408 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51373 invoked by uid 1010); 6 Mar 2004 17:21:41 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 51349 invoked by uid 1007); 6 Mar 2004 17:21:40 -0000 Message-ID: <20040306172140.51328.qmail@pb1.pair.com> To: internals@lists.php.net Date: Sat, 06 Mar 2004 18:21:38 +0100 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031221 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 X-Enigmail-Version: 0.82.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 80.126.21.70 Subject: __destruct() behaviour From: abies@php.net (Ard Biesheuvel) While http://www.php.net/zend-engine-2.php claims the following 'Like constructors, parent destructors will not be called implicitly by the engine. In order to run a parent destructor, one would have to explicitly call parent::__destruct() in the destructor body. the following code php -r 'abstract class A { protected function __destruct() {} } class B extends A {} $b = new B;' results in Warning: Call to protected B::__destruct() from context '' during shutdown ignored in Unknown on line 0 which is inconsistent with the quoted description. It also introduces an asymmetry compared to constructors which I think is confusing. Any thoughts ? -- Ard