Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82452 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 73119 invoked from network); 11 Feb 2015 08:16:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Feb 2015 08:16:39 -0000 Authentication-Results: pb1.pair.com smtp.mail=xinchen.h@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=laruence@php.net; sender-id=unknown Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.215.43 as permitted sender) X-PHP-List-Original-Sender: xinchen.h@zend.com X-Host-Fingerprint: 209.85.215.43 mail-la0-f43.google.com Received: from [209.85.215.43] ([209.85.215.43:42790] helo=mail-la0-f43.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1C/2F-33902-2EF0BD45 for ; Wed, 11 Feb 2015 03:16:35 -0500 Received: by labgf13 with SMTP id gf13so1784024lab.9 for ; Wed, 11 Feb 2015 00:16:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=qMIEO4GEtQ48o16HT7RUy0pBDvWnQZ4BMo02VqLqU2s=; b=HB5kvTMM9Nthq0Ix9dyXwsPibZCWNCxDn9ke/lXzhbc1vUuGEPqw2nJBmBJC+zr1PL d6qrRA8bstYfkJ4RreO0zP9lzYkb2dqmc59ayPa70hXndnOb1lEd8LPe9iAot9Q8lUmG lCG6v2BsElJBvIT1M0dSONmEXy5UnTlkhNbOawXZrknVkNOOQa+mFVvufMdpZErQn0tz y1ZLLs+F0MRtxZ9sjbnc6wrYeTbjEa0xRN0j9r4pD/kXd8x+ke1Ffbv3h5LRGhWUfzUV YPpS6DEH/QK5m51BFc4UzSy+MyMbGoe4wUjzuq/DT7qMhSFrwPLTS5RHQIyokrTqyCtu PKLg== X-Gm-Message-State: ALoCoQkeg+GekxFn5u9l/mPE7GHt+CRGfCIDmwRQTiMY8JMQiPLyc1xIBziZpMby5Ne5NQkoTjzASUU/in3HtQ+3TIWTCVY5jC1V5Z6JpKBKiaQH+Lu1/S0Y2epAQEOhTSVp5ZWLsoFjfsziuhJjwYypco5TB0OawQ== X-Received: by 10.112.150.98 with SMTP id uh2mr26078905lbb.92.1423642591648; Wed, 11 Feb 2015 00:16:31 -0800 (PST) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPSA id cb5sm29982lad.3.2015.02.11.00.16.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Feb 2015 00:16:30 -0800 (PST) Received: by labge10 with SMTP id ge10so1745520lab.12 for ; Wed, 11 Feb 2015 00:16:29 -0800 (PST) X-Received: by 10.152.207.108 with SMTP id lv12mr26642778lac.94.1423642589491; Wed, 11 Feb 2015 00:16:29 -0800 (PST) MIME-Version: 1.0 Received: by 10.114.28.193 with HTTP; Wed, 11 Feb 2015 00:16:09 -0800 (PST) In-Reply-To: References: Date: Wed, 11 Feb 2015 16:16:09 +0800 Message-ID: To: reeze Cc: "internals@lists.php.net" , Dmitry Stogov , Yasuo Ohgaki Content-Type: text/plain; charset=UTF-8 Subject: Re: Proposal: Introduce a new macro:php_error_docref_ex() From: laruence@php.net (Xinchen Hui) On Wed, Feb 11, 2015 at 4:07 PM, 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? No. I can't see any benefit from it, but lots of changes. everything works well now. thanks > > [1] https://github.com/php/php-src/pull/1075 > > -- > Reeze Xia > http://reeze.cn -- Xinchen Hui @Laruence http://www.laruence.com/