Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114817 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 7798 invoked from network); 10 Jun 2021 15:35:02 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 Jun 2021 15:35:02 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id EB64F180507 for ; Thu, 10 Jun 2021 08:50:19 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-yb1-f180.google.com (mail-yb1-f180.google.com [209.85.219.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 10 Jun 2021 08:50:19 -0700 (PDT) Received: by mail-yb1-f180.google.com with SMTP id g142so22123475ybf.9 for ; Thu, 10 Jun 2021 08:50:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datadoghq.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CFd82cAfydDDkuay/DTaq+MSxKkvgIiRy12vTbyH/OY=; b=JpVOkXCL0XL9VNavavV5zjyl8i00l5UsHOxBiXgpnA6Ej5fWYyvFk6dY0H/sHl4doS 5FM42gaKQXfqnSl89sPYmhMXX6cNGT8g6ID6uixPUU5GI3eZHCbarsFRpHsrbhRgU1t+ q2o0ZCnaYp0C3lic92S9M8ALZB23gx8fRsD58= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CFd82cAfydDDkuay/DTaq+MSxKkvgIiRy12vTbyH/OY=; b=hYm4u4xZLYHwDSb97SeUV+GCDo8Hh6cAb3gOt05FEs4CjYV7/ooAl0aJ78Y73ke73F 3qYf+TP/WXMxxLnP7EVQqUgy+oA/oIkurOmPr4mHMnxqsWEOycGJR91XbHxgDLxJq5Yx vhoAA+RPYxGIR2mUCIbqdCpYL9Q+fZajcaGwblBBaFFjPOZ/lt3kWHM5i7VL/uCu+6Ff s9aQscgKaYcFynP/ZEpvoIBDVCiL7I1uAhJvwzY8YEcXg0+ZcKSbYFia3srBjXVM4qPZ 5beWwkaibcOrMshRM5BPPepIo13JPiV0DCrqjBtebNeA2aG3JdLIBB2FBUkCl1Q/BJTU E7oA== X-Gm-Message-State: AOAM533Xq0LVd/ESnrzElWKpmjIQdQs8oxQYuYCXkOz/dZiFwkUIMI23 M231tmmieyRTxMAOxnMWrT8njIZCmVp9+8SXq23AH0DB7Ds= X-Google-Smtp-Source: ABdhPJyV4AV3O27/wnFaWrcoRM/Tw4dpOnPyVDh1vU3YnJwXJDrasHNJ60+OejsTjG8SXhkN94gd5ier1hib5Onuom8= X-Received: by 2002:a25:4d4:: with SMTP id 203mr7999201ybe.367.1623340218030; Thu, 10 Jun 2021 08:50:18 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Reply-To: Levi Morrison Date: Thu, 10 Jun 2021 09:50:07 -0600 Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Re: Allow combining arg unpacking and named args From: internals@lists.php.net ("Levi Morrison via internals") On Thu, Jun 10, 2021 at 7:14 AM Nikita Popov wrote: > > On Tue, May 25, 2021 at 4:18 PM Nikita Popov wrote: > > > Hi internals, > > > > Currently, argument unpacking (...$foo) cannot be combined with named > > arguments (foo: $bar) at all. Both func(...$args, x: $y) and func(x: $y, > > ...$args) are rejected by the compiler. > > > > https://github.com/php/php-src/pull/7009 relaxes this by allowing > > func(...$args, x: $y). The named arguments are required to come last, > > because this automatically enforces the invariant that named arguments must > > be sorted after positional argument. > > > > Are there any concerns with relaxing this restriction? > > > > Any further feedback on this? > > Nikita No objection. In my head I figured the unpack would come after named parameters, but it makes sense that an unpack which can contain both positional and named arguments would come between the positional and named arguments.