Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82453 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 73421 invoked from network); 11 Feb 2015 08:16:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Feb 2015 08:16:51 -0000 Authentication-Results: pb1.pair.com smtp.mail=reeze.xia@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=reeze.xia@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.181 as permitted sender) X-PHP-List-Original-Sender: reeze.xia@gmail.com X-Host-Fingerprint: 209.85.212.181 mail-wi0-f181.google.com Received: from [209.85.212.181] ([209.85.212.181:37651] helo=mail-wi0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 69/3F-33902-2FF0BD45 for ; Wed, 11 Feb 2015 03:16:51 -0500 Received: by mail-wi0-f181.google.com with SMTP id r20so2855565wiv.2 for ; Wed, 11 Feb 2015 00:16:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=eviqpOzoMpkXJYeoqo2xtGM7LUeBbW741Z7JGTQG2oA=; b=Vc0KUTSVaqYunGzUThjESWD/UQYvFv3jpQwo8DFapT2EulD52Kd+8ugbrHN1vyz1Pt SzDjbzQKQiaLVZNaa6OnbU0q/r3m9ZIPhbGUFLSl286G+7WWaXWhcHcc6Lu/j6eelIGN YpeYcTxEpSddqRHG5I5Out/TiPKvDb8toeDzBlBT2luvMH3O9AW1Sf+RsRmWzCd/EP1G /tRIhGBPvXzIuWPuVEmxS6yK9ZNQfYKMb8IzNlURKgXe1lopLFIznNRyPjMQyBid+JqX b83ZFANdCJtkyI1+i3lxjOTtv/AMhy8pf3+5nYrCgJugiw4t0f/rkKZ8D3fPMn8/OcRj 6ifA== X-Received: by 10.195.13.104 with SMTP id ex8mr59077558wjd.12.1423642607554; Wed, 11 Feb 2015 00:16:47 -0800 (PST) MIME-Version: 1.0 Sender: reeze.xia@gmail.com Received: by 10.194.193.5 with HTTP; Wed, 11 Feb 2015 00:16:27 -0800 (PST) In-Reply-To: References: Date: Wed, 11 Feb 2015 16:16:27 +0800 X-Google-Sender-Auth: To5gnNkfeYIs4GY6ZO0Ypv-vjCc Message-ID: To: "internals@lists.php.net" , Dmitry Stogov , Xinchen Hui , Yasuo Ohgaki Content-Type: multipart/alternative; boundary=047d7bfd0920e9177b050ecb9f6a Subject: Re: Proposal: Introduce a new macro:php_error_docref_ex() From: reeze@php.net (reeze) --047d7bfd0920e9177b050ecb9f6a Content-Type: text/plain; charset=ISO-8859-1 PS: Github search result: https://github.com/search?l=c&q=php_error_docref&ref=searchresults&type=Code&utf8=%E2%9C%93 It seems that no one need the docref at all. On 11 February 2015 at 16:07, reeze wrote: > Hi all, > There are a lot of code use php_error_docref() macro, the first > parameter > mostly is NULL, before PHP7, it looks like: > > *php_error_docref(NULL TSRML, E_WARNING, "recursion detected");* > in PHP7 > *php_error_docref(NULL, E_WARNING, "recursion detected");* > looks better, but the first parameter look dumb. > > I did a simple statics, there are: > > Null docref: 2530 > Not Null docref: 51 > > I searched on Github, it seems that almost all of the extension use NULL > docref. > > So I propose add a new macro, like: php_error_error_docref_ex(E_WARNING, > "xxx"). > this could make code looks better and the extension maintainer's easier. > > Another option would be just update the php_error_docref() macro to remove > the docref parameter, default to NULL but not add a new macro. > > > What do you think about it? > > [1] https://github.com/php/php-src/pull/1075 > > -- > Reeze Xia > http://reeze.cn > -- Reeze Xia http://reeze.cn --047d7bfd0920e9177b050ecb9f6a--