Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:59183 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31462 invoked from network); 27 Mar 2012 13:44:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Mar 2012 13:44:08 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@googlemail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@googlemail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.217.170 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@googlemail.com X-Host-Fingerprint: 209.85.217.170 mail-lb0-f170.google.com Received: from [209.85.217.170] ([209.85.217.170:62497] helo=mail-lb0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3E/9C-04438-724C17F4 for ; Tue, 27 Mar 2012 08:44:08 -0500 Received: by lbbgg13 with SMTP id gg13so4834544lbb.29 for ; Tue, 27 Mar 2012 06:44:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=fuBFjJpHT8SExHgI86pmp1vDit3XP6ukgfE70OBf+GA=; b=v3l9/+JWyBHb2rFYmmVXtnlx496JofEjHWwWm5p2AzNPk7VN+jqLN0dDNunwubx0Sd bZ0wCExQyks4ylMlAOA6b/GyXQ33WGOtAGMXk5zj0kATt8hwgVCjV6wS5TXjXI+RFPsD 9SIlGKCh/sEd0KOE/0+yx/EcKe+fmyh3PQkNhkj6eGt90roK7Q9PSecbE02FpTX8elSv MdnpFUdKNDtgZY43yGh2yiCJdoyfURj4sq8DH5xxJkljpOl4eTAKRuhyL1+c9l8ZIc29 zxD3px8ygiiU0xQL4JbcnW+uAzcx2SnMtGTGPxAeT/PsFV9AL+MdmzwUOMkevAdQktmb jAUQ== MIME-Version: 1.0 Received: by 10.152.106.145 with SMTP id gu17mr19028994lab.13.1332855844391; Tue, 27 Mar 2012 06:44:04 -0700 (PDT) Received: by 10.152.127.68 with HTTP; Tue, 27 Mar 2012 06:44:04 -0700 (PDT) In-Reply-To: <4F6E20A6.1020209@sugarcrm.com> References: <4F6E20A6.1020209@sugarcrm.com> Date: Tue, 27 Mar 2012 15:44:04 +0200 Message-ID: To: Stas Malyshev Cc: PHP internals Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] set_error_handler and set_exception_handler behavior From: nikita.ppv@googlemail.com (Nikita Popov) On Sat, Mar 24, 2012 at 8:29 PM, Stas Malyshev wro= te: > I don't think ability to reset handlers by passing null is a big > problem, and creating another four functions seems excessive to me. > Also, the use case for the latter ones is not clear - why would you need > old error handler if you are not changing it? If you are changing it, > the case for getting the old one is clear - you may want to restore it > later. But if you're not, why you'd need it? Agree. > As for returning true on null, I see no sense if this behavior. Can > anybody explain to me what is it useful for? Why not return old handler > just as it is done in all other cases of setting the handler? Agree. >> What I would do: >> =A0Add support for set_error_handler(NULL) and change the return value >> of set_error_handler(NULL)+set_exception_handler(NULL) to the previous >> handler (i.e. Stas option). I implemented this option in this PR: >> https://github.com/php/php-src/pull/20 > > I think this makes sense (of course, since it's my proposal :). It is a > behavior change, so it should be confined to master branch. Not sure about that part. I think both changes should be considered as bug fixes and as such should also be eligible for 5.3/5.4. The set_error_handler(null) change has no impact on BC whatsoever and the return value change only has a theoretical BC impact (why would you check the return value if it is *always* true?) Nikita