Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84222 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 81413 invoked from network); 3 Mar 2015 10:13:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Mar 2015 10:13:37 -0000 Authentication-Results: pb1.pair.com header.from=reeze.xia@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=reeze.xia@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.169 as permitted sender) X-PHP-List-Original-Sender: reeze.xia@gmail.com X-Host-Fingerprint: 209.85.212.169 mail-wi0-f169.google.com Received: from [209.85.212.169] ([209.85.212.169:36825] helo=mail-wi0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E5/B1-03783-F4985F45 for ; Tue, 03 Mar 2015 05:13:35 -0500 Received: by widem10 with SMTP id em10so21482998wid.1 for ; Tue, 03 Mar 2015 02:13:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:from:date:message-id:subject:to:content-type; bh=BQwWzzFy3b3fpDeeOqZwl/D0BXcAd4wcy/A2uneB7jQ=; b=FrTmrKEH/2a5Dz5D35oz+iKCtVY8wV2kw3SnjwT9K7lecoyCjIxRVN6QbI3RGM7DJ1 T5ReajhjUCjijPbyDt0TzrEnXMMVmsRahaxL/FcFlgj6YeKxK/IrHMpA9KQT8XLXXD7N EX7nExaanhOmHxGrKkkPplX551WBqmHILU26RAuZnsCLdi+gQYbTZil5Ej8tNLtbBGjA mryGEvXVBZU7leMuR3+kOEpIWXK9y4YLj+YhKnxib6i4qXPuTVqJ33p5ASNQ0Jh73pUL Bc+eNuP9g2yPW8j6jQKY8X+0SluADjU7KVnkpR3duVNLNQOJIhU42iF9mdtZDfDnq2GS VX0A== X-Received: by 10.181.8.225 with SMTP id dn1mr45496057wid.55.1425377611479; Tue, 03 Mar 2015 02:13:31 -0800 (PST) MIME-Version: 1.0 Sender: reeze.xia@gmail.com Received: by 10.194.193.5 with HTTP; Tue, 3 Mar 2015 02:13:11 -0800 (PST) Date: Tue, 3 Mar 2015 18:13:11 +0800 X-Google-Sender-Auth: UKaMBpaeabpZGOK7MDDyID-DTL0 Message-ID: To: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a1134b5fa350f5505105f960e Subject: [Disccusion] Introduce error_clear_last() function From: reeze@php.net (reeze) --001a1134b5fa350f5505105f960e Content-Type: text/plain; charset=ISO-8859-1 Hi internals, I would like to implement FR #45235. below copied from Github. What do you think about it? ----- You can view the Pull Request on github: https://github.com/php/php-src/pull/1135 Pull Request Description: In PHP a simple assign expression would raise error, if user use error_get_last() to check they can't guarantee the call site raise the error. This patch implement a function to clear the error state. http://php.net/error_get_last The top voted user contributed note are a tricky way to clear last error. also there are a lot of apps use the similar hacks. 1. https://github.com/mathnerd3141/doeqs_new/blob/ba23c478a0c819dc6b2f8f96f9df35d16505eed2/errors.php#L20 2. https://github.com/benfinke/cargo_plane/blob/4911bc6a91d8345aa62c81fb52c8bed9d216c44e/Splunk/Util.php#L89 Request: https://bugs.php.net/bug.php?id=45235 -- Reeze Xia http://reeze.cn --001a1134b5fa350f5505105f960e--