Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102557 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30242 invoked from network); 3 Jul 2018 10:12:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Jul 2018 10:12:01 -0000 Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.51 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.214.51 mail-it0-f51.google.com Received: from [209.85.214.51] ([209.85.214.51:36938] helo=mail-it0-f51.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 72/80-15351-0FB4B3B5 for ; Tue, 03 Jul 2018 06:12:01 -0400 Received: by mail-it0-f51.google.com with SMTP id p17-v6so2328134itc.2 for ; Tue, 03 Jul 2018 03:12:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=cAXbnJ5LqhQC7dY4CdUG9S8OlqWcuwWxOEh+zdxEimY=; b=dTiATyZ4g73fT4TRlT8/6YC5Zl8beDs0xfL2ZoOjt6GEdghDSeBSRIooFXS7bjgHdw kLvG37Uzdnpalm2yHc8WyHBc2a3YUeKboIazUoPlOhA/jKV8u/LJOk6/mr9xDhyz2bDC qjHJAAmR1AcqTGR0PqxWg1b2I92Mr26pz5wIvd9u44Y8lKZ7L+dZ41GTlvCtId3miwcA zPj4Xa+qfObyfOyk0KCB+DBzp0Vym27jxLabJOPiErIzMJ+wIRVh71naFqd9SM/+5sOz 3PQl5+GcylY5kVyc94mjsDZTXagTLM3wSjPGaT8zuqBDLr5GZXkG9D83uEiGvR9WTqbY GvTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=cAXbnJ5LqhQC7dY4CdUG9S8OlqWcuwWxOEh+zdxEimY=; b=C/1C8IcVTnHh4bgO1dmcrJPAWd31VUnD1ccILz/vDXBzGr+1IzWQqn/vTsnsy6H+zK SrY1ZyY3k+nM93PxHFNv/Qc6Rv5fEqoIRAwUp5mV3grU/4whJ4FiBo326hrqTrLy2MNv +L29q1Z+ujW1YeCQpqgC30LO2F4kOGmHsjqY+JPPdmSsIlFTubdpDy3rE3pFfafpngMZ aumx1jLuqERmq5WEryKLJHKuAGe2byBHNR7yBXji57werqauQz3w6tfMlcw/FxYkjsC7 ZAz7zJdlhIAD6tmY/EFE4A8VZ3T0+roSDt+ut2jVc6n+ibJVlWPzMECXtqE39q3qrmPt cjTA== X-Gm-Message-State: APt69E1X/vJZT0OSH25f8kDgPrlSUQi7jvDKxJFoNG9mF53ngbb1VLTd WUuJ2WW4qOa/1o8ISNS3WnF2uA0RpYurhiRLsRA= X-Google-Smtp-Source: AAOMgpe6ICfEmR+hJE+/+Itl35TQmFdGm6Bsh1+PSQDj4HgE+6pNLEgc2oXMTr7HzzVnO5AqpOdL59bFODTDFigmTkQ= X-Received: by 2002:a24:3c41:: with SMTP id m62-v6mr3315341ita.63.1530612718525; Tue, 03 Jul 2018 03:11:58 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:148a:0:0:0:0:0 with HTTP; Tue, 3 Jul 2018 03:11:58 -0700 (PDT) In-Reply-To: <40eb9575-2bde-05a3-c176-fc98f595c583@gmx.de> References: <5787528b-eddb-7fcb-c43d-3b4211073ab4@gmx.de> <40eb9575-2bde-05a3-c176-fc98f595c583@gmx.de> Date: Tue, 3 Jul 2018 12:11:58 +0200 Message-ID: To: "Christoph M. Becker" Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000006060430570158bd6" Subject: Re: [PHP-DEV] Excess arguments for internal functions From: nikita.ppv@gmail.com (Nikita Popov) --0000000000006060430570158bd6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jul 2, 2018 at 11:45 PM, Christoph M. Becker wrote: > On 02.07.2018 at 23:16, Nikita Popov wrote: > > > On Mon, Jul 2, 2018 at 11:00 PM, Christoph M. Becker > > wrote: > > > >> Is there any particular reason why internal functions raise a warning/= an > >> error regarding excess arguments, unless they are not supposed to > >> receive any arguments at all? In other words, why don't we use > >> ZEND_PARSE_PARAMETERS_NONE() (except for net_get_interfaces())? > > > > The more common macro for this is zend_parse_parameters_none(), which a > > quick grep shows to be used by 519 functions. If a function accepts no > > arguments and does not use zend_parse_parameters_none(), that's > generally a > > bug. > > Ah, thanks! I couldn't find zend_parse_parameters_none() in > README.PARAMETER_PARSING_API[1] =E2=80=93 guess it should be added there. > > Anyhow, I've noticed this due to bug 33502[2], and indeed for > output_reset_rewrite_vars()[3] there is still no ZPP in place. Then > I've checked func_num_args()[4] (which just came to mind), and found > that it doesn't do any ZPP either, as well as other parameterless > functions defined immediately before it. > > Should these (and other occurences, if there are any) be fixed for > PHP-7.1, or for master only? I'm somewhat concerned regarding the > potential BC break, particularly with strict_types. > I'd go for master only as it's technically BC breaking. Some people have plans to get rid of the warning/error on too many arguments to internal functions to make them consistent with user functions, so maybe this will become unnecessary in the future. But given the current state of things, it would certainly be good to add zend_parse_parameters_none() calls where they are missing. Nikita --0000000000006060430570158bd6--