Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:18714 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20408 invoked by uid 1010); 8 Sep 2005 11:34:24 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 20392 invoked from network); 8 Sep 2005 11:34:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Sep 2005 11:34:24 -0000 X-Host-Fingerprint: 82.94.239.5 jdi.jdi-ict.nl Linux 2.5 (sometimes 2.4) (4) Received: from ([82.94.239.5:50868] helo=jdi.jdi-ict.nl) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 64/00-23233-FB120234 for ; Thu, 08 Sep 2005 07:34:23 -0400 Received: from localhost (localhost [127.0.0.1]) by jdi.jdi-ict.nl (8.12.11/8.12.11) with ESMTP id j88BYKGx024218; Thu, 8 Sep 2005 13:34:20 +0200 Received: from localhost (localhost [127.0.0.1]) by jdi.jdi-ict.nl (8.12.11/8.12.11) with ESMTP id j88BYDRh024189; Thu, 8 Sep 2005 13:34:16 +0200 Date: Thu, 8 Sep 2005 13:34:13 +0200 (CEST) X-X-Sender: derick@localhost To: Stanislav Malyshev cc: internals@lists.php.net In-Reply-To: Message-ID: References: <5.1.0.14.2.20050904235929.06963d60@localhost> <431D9B9E.6080303@ntlworld.com> <57792e85050906111963cd6303@mail.gmail.com> <6.2.3.4.2.20050907164645.0905ed90@localhost> <43201B61.4070306@emini.dk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at jdi-ict.nl Subject: Re: [PHP-DEV] Re: 5.0.5 From: derick@php.net (Derick Rethans) On Thu, 8 Sep 2005, Stanislav Malyshev wrote: > DR>>But they can still do that.. With "shutdown functions" I meant > DR>>functions registered with register_shutdown_function(). > > Ah... This is smaller problem - register_shutdown_function() ones can be > called on "before dtors" stage. Indeed, we've always done this too... I've a patch ready to commit for PHP 5.1/6.0 for this: diff -u -p -d -r1.640 main.c --- main.c 5 Aug 2005 21:44:26 -0000 1.640 +++ main.c 8 Sep 2005 11:33:43 -0000 @@ -1197,16 +1197,16 @@ void php_request_shutdown(void *dummy) EG(opline_ptr) = NULL; EG(active_op_array) = NULL; - /* 1. Call all possible __destruct() functions */ - zend_try { - zend_call_destructors(TSRMLS_C); - } zend_end_try(); - - /* 2. Call all possible shutdown functions registered with register_shutdown_function() */ + /* 1. Call all possible shutdown functions registered with register_shutdown_function() */ if (PG(modules_activated)) zend_try { php_call_shutdown_functions(TSRMLS_C); } zend_end_try(); + /* 2. Call all possible __destruct() functions */ + zend_try { + zend_call_destructors(TSRMLS_C); + } zend_end_try(); + /* 3. Flush all output buffers */ zend_try { php_end_ob_buffers((zend_bool)(SG(request_info).headers_only?0:1) TSRMLS_CC); Derick -- Derick Rethans http://derickrethans.nl | http://ez.no | http://xdebug.org