Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95455 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34820 invoked from network); 26 Aug 2016 14:48:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Aug 2016 14:48:45 -0000 Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.170 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.213.170 mail-yb0-f170.google.com Received: from [209.85.213.170] ([209.85.213.170:35995] helo=mail-yb0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AB/2B-34481-BC650C75 for ; Fri, 26 Aug 2016 10:48:43 -0400 Received: by mail-yb0-f170.google.com with SMTP id e31so27726903ybi.3 for ; Fri, 26 Aug 2016 07:48:43 -0700 (PDT) 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:cc:content-transfer-encoding; bh=QsuCcyQy2utVKyU57RMCj+TX+szxqWuf1HqUabpP8g0=; b=RPqTMhSYFjSkw8kSQ1wdHk1igJXuC/Tl1eH6sSCdACwGH3YNzgdh5wYvQdB5+1QSjk jp9FP5NkQULsKOgIEnzLC6qKj5qeZkU5Dw38H4jy4XmPpF0/HdXulVhmlJeO43mRm4yN tVJl1shEzVDdnKvhErZpyVLmN2rJuFFOUuQPdUeBMXM67c0NJvoJZGM40vwSFJkzofi3 SNXCRQvfQYihc0LVTR7kqaFgEcLXGl6SeZWX0XdVUl2/E4eRewMjTMqF+3dtvslf0rNm oKCGygyap4s/3iOx44Q/Rp+r33VKKyoOakYoKRj5yHEUT3m/tstR7Og9Z2p82wke+ut3 OfdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=QsuCcyQy2utVKyU57RMCj+TX+szxqWuf1HqUabpP8g0=; b=lgMSUbgU8bNfxIpBT6n5knKrfbYjiMjYTpgataaobONtHKgc33IJY34yQD6ooa0kS4 s1SUX1WBHi5qRRkqvApI0XiiQFHoVuDiWvXR0/LLB7XQT0m6kk2fv8oVN3dmw1gG6jIR +nuwuxk2svwwwQ3VuI+3miNzGDvAGy5ssBBOAnLAvPnWrZQa146uBn2B8VIrHW/2Pl0O bBKXpIEJiCoDrhexwC2w9mh3iyT9cKn2im3g3vePOJAvDX8/O3oo9pk/qv3EboVaaXnI uu39ylBW4fF4cA8cFfXpYDSEWeph3ux6O2GLStC9bLTY+VvGP1EZXhsQ/JqjAeegELO/ NQ/Q== X-Gm-Message-State: AE9vXwPYK7w2Jo3qrB4Xxvup/8uyrbf4hEo/kzHrbxn7d4T6FG0NQDidQcAsibg4XlhnG783x8TYLIj+iRJGIA== X-Received: by 10.37.204.202 with SMTP id l193mr3379410ybf.166.1472222920304; Fri, 26 Aug 2016 07:48:40 -0700 (PDT) MIME-Version: 1.0 Sender: morrison.levi@gmail.com Received: by 10.13.193.66 with HTTP; Fri, 26 Aug 2016 07:48:39 -0700 (PDT) In-Reply-To: References: <7cdd89c1-3fe5-3455-2f03-d5f6648d93d1@gmx.de> Date: Fri, 26 Aug 2016 08:48:39 -0600 X-Google-Sender-Auth: 9-KvcId-Qlq60hemSBQv5-o3JhU Message-ID: To: "Christoph M. Becker" Cc: Davey Shafik , Nikita Popov , PHP internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Reverting "Too Few Arguments Exception" RFC From: levim@php.net (Levi Morrison) On Fri, Aug 26, 2016 at 4:53 AM, Christoph M. Becker wr= ote: > On 25.08.2016 at 18:37, Davey Shafik wrote: > >> On Thu, Aug 25, 2016 at 8:12 PM, Christoph M. Becker >> wrote: >> >>> Indeed, the RFC explicitly claims: >>> >>> | Behavior of internal functions is not going to be changed. >> >> This is correct for functions that had the correct behavior before >> (everything but array functions). >> >> I can remove that part of the change =E2=80=94 but if we're going to cha= nge it, >> doing in 7.1 rather than > 7.1 would be best. > > AIUI, the actual implementation of the too_few_args RFC does what it > says, namely to not affect the behavior of internal function at all. > The issue you've raised is that we have introduced an inconsistency, > because some internal functions (e.g. array_diff) behave differently. > > If that is so, reverting the too_few_args RFC is out of question, > because not changing the behavior of internal functions was intentional, > and I assume that everybody who voted on the RFC was aware of that. > > The inconsistency between internal functions wrt. to too few/many > arguments in strict_types mode is not related to the too_few_args RFC at > all =E2=80=93 we have this as of PHP 7. Fixing this inconsistency as soo= n as > possible might be desirable, but it seems to me that is not even > possible in the general case, as not all relevant code is under our > control (think of PECL and even "private" extensions). > > So, even we "fix" the behavior of all bundled internal functions, we > still can't claim that *all* functions throw an exception when called > with too few or too many arguments in strict_types mode (besides that we > easily might miss a few cases). If the docs already make this claim, > the docs should be fixed. > > Finally, I wonder why array_diff(), for instance, even has an explicit > check for ZEND_NUM_ARGS() and for Z_TYPE() !=3D IS_ARRAY instead of > properly invoking zend_parse_parameters() with "aa+" instead of "+" in > the first place? Maybe I'm missing something, but otherwise I would > suggest to fix that altogether instead of piecemeal, even if that has to > wait until 8.0. > > -- > Christoph M. Becker > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php Well, its behavior does differ with a single array: it will preserve keys in this case. If more than one array is passed it will numerically index the keys starting at zero. This is the only reason I can think of.