Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53386 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35169 invoked from network); 20 Jun 2011 11:37:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jun 2011 11:37:38 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes@schlueters.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=johannes@schlueters.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain schlueters.de from 217.114.211.66 cause and error) X-PHP-List-Original-Sender: johannes@schlueters.de X-Host-Fingerprint: 217.114.211.66 config.schlueters.de Received: from [217.114.211.66] ([217.114.211.66:36348] helo=config.schlueters.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 68/2A-34681-0013FFD4 for ; Mon, 20 Jun 2011 07:37:37 -0400 Received: from [192.168.2.230] (ppp-93-104-43-78.dynamic.mnet-online.de [93.104.43.78]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by config.schlueters.de (Postfix) with ESMTPSA id 2F5897440E; Mon, 20 Jun 2011 13:37:33 +0200 (CEST) To: Arpad Ray Cc: internals@lists.php.net In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Date: Mon, 20 Jun 2011 13:37:27 +0200 Message-ID: <1308569847.3172.18.camel@guybrush> Mime-Version: 1.0 X-Mailer: Evolution 2.30.2 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [PATCH] unregister_shutdown_function() From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) On Mon, 2011-06-20 at 07:36 +0100, Arpad Ray wrote: > This patch implements unregister_shutdown_function(), which removes a > function already registered with register_shutdown_function(). > > It resolves request #53702 (according to google, not sure if it's > still active) and I've thought it a curious absence for a while. Why do you register a shutdown function if you want to remove it again? Shouldn't you fix the architecture of your code instead of relying on such functions? > The patch (against trunk) is at: > http://spellign.com/patches/php-trunk-unregister_shutdown_function.patch Does register_shutdown_function() work with closures? (Didn't test it) Then the following should work, too, which isn't the case in your code: $a = function() {}; register_shutdown_function($a); unregister_shutdown_function($a); I also think once that functionality is there the next request will be get_registered_shutdown_functions() or something along the lines. johannes