Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82448 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66871 invoked from network); 11 Feb 2015 08:08:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Feb 2015 08:08:04 -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.172 as permitted sender) X-PHP-List-Original-Sender: reeze.xia@gmail.com X-Host-Fingerprint: 209.85.212.172 mail-wi0-f172.google.com Received: from [209.85.212.172] ([209.85.212.172:41215] helo=mail-wi0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 08/CD-33902-2ED0BD45 for ; Wed, 11 Feb 2015 03:08:03 -0500 Received: by mail-wi0-f172.google.com with SMTP id z2so20377490wiv.5 for ; Wed, 11 Feb 2015 00:07:59 -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=POjGH7WGOYYkE1FnrmE5majlBu8TAm/vTL0Vorcph2M=; b=abFOdxgQWyVwmQCKNUut8veIvMWS3iAsFV6gCtNAW93BuAnxmnDLU8QyXrXbu0RoF9 h5vzfUXxP2p6JGNxmVB0aQEVg5SvOnrTn8vFVjGYTEvUbqUKC1kbgEoPPSJlAFduW78u yCuDt7/h16GU/SFLoEuJE669Lw7yOSuyxPSwxYWuAZYLpY9P9B64vzueEMprMru22iif 6i/TOqGizL/gPcyOg8zhzxaNagwlRWg/qboKBPQUeKGtmdLZLLNpFgpwVG9jE7BGD/Du MHofXSZ3tVmGHwUZSkSrRsuPJlYfcKFXeoiPEvgZQH8/pUPf7De87mE7s1dWbjr3knIE e1vQ== X-Received: by 10.180.206.195 with SMTP id lq3mr53311704wic.73.1423642079776; Wed, 11 Feb 2015 00:07:59 -0800 (PST) MIME-Version: 1.0 Sender: reeze.xia@gmail.com Received: by 10.194.193.5 with HTTP; Wed, 11 Feb 2015 00:07:38 -0800 (PST) Date: Wed, 11 Feb 2015 16:07:38 +0800 X-Google-Sender-Auth: sur_OEU0DXBUK1uiS652LHtTgXI Message-ID: To: "internals@lists.php.net" , Dmitry Stogov , Xinchen Hui , Yasuo Ohgaki Content-Type: multipart/alternative; boundary=001a11c3847473d62f050ecb80bc Subject: Proposal: Introduce a new macro:php_error_docref_ex() From: reeze@php.net (reeze) --001a11c3847473d62f050ecb80bc Content-Type: text/plain; charset=ISO-8859-1 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 --001a11c3847473d62f050ecb80bc--