Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114007 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 87130 invoked from network); 9 Apr 2021 07:23:58 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 9 Apr 2021 07:23:58 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 155BD180532 for ; Fri, 9 Apr 2021 00:23:39 -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,FREEMAIL_FROM,HTML_MESSAGE, 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-oi1-f175.google.com (mail-oi1-f175.google.com [209.85.167.175]) (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 ; Fri, 9 Apr 2021 00:23:39 -0700 (PDT) Received: by mail-oi1-f175.google.com with SMTP id 25so3392998oiy.5 for ; Fri, 09 Apr 2021 00:23:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=NEc8QxOGHTnGPTSdD7xaMsPBbUOUFKu4jSnYhDbKV9o=; b=LWx1FQSsnWM7+I/QwS8xcmJZwxTWKVA9FBMiEnXgks/evRpfv7ESy96F5h95RTu4XW +/TOtnNCtGtJmalIJZsgTtrVyCvejt/2sjphNtZzS9xySuVxgMUkATgRhDgJhghUHQtD QjnO2ls5DO7U6KhjiZttR7HL0PyHI1QRZpQv0FDEkNRpzQWT1SOgPqHt88lL7RJfZ7kE lU0lA8AnUABxHl2kZ1IPY2sLJVTfgWHrAT2QaIhs4JehAso6C5yF/oYcEji55DlYaz4R tOCfKBehyzQihyzrvuGHRmM1mO9wNglC7GxHf0C3vKIzbpue6BEik1NSOwskwF6JBrDA 7IgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=NEc8QxOGHTnGPTSdD7xaMsPBbUOUFKu4jSnYhDbKV9o=; b=SwFhm2g5XsvA7NIim05kjzdsKlN6BP4776OR+XILqADCJ7b0u16DAMxFO1EfFnmYg/ v4mvkFHMNeHJhmNQcXt9R83x95kCB0W6jkAVcrKES4BvLGIv0pO+w49bfwtt8J55FwN2 sukpSMclI/aFSSf2jkmbEPT6bKrawtiCJMU8uHeHLlqLZayyZEYq0AbrGLOQxEgRxPVv NAg4XmNJNx4NkSVAhRa4cN+HnOQPnYzIXK5DTbfFUF0E0aSnFSO4LLugDGqVazVqKyt5 FWke28Y9gQcVXVBCx4oY6EPPdoMwfP6cHzliTHHREz7p3YiOC5YBhBmmcB7+E+kXeiui drEw== X-Gm-Message-State: AOAM533EsANXffihLMouM9QmL8ONYkKPLB1BQPNMGK+qTKb3WfdsgN87 cM6N2SpG22+JyKSk7LX1lgN+h4fPi3IcNeE5FJweqbGE1cE= X-Google-Smtp-Source: ABdhPJzoV01yANnvSbEE8OBwoQo3fInmYyKff3Zu42cEhjmdf7qnirOvamFJgijHaHa2LJARApiYNTKlTWuDiaD1fTs= X-Received: by 2002:aca:ea06:: with SMTP id i6mr9199066oih.82.1617953016878; Fri, 09 Apr 2021 00:23:36 -0700 (PDT) MIME-Version: 1.0 Date: Fri, 9 Apr 2021 09:23:26 +0200 Message-ID: To: PHP Internals Content-Type: multipart/alternative; boundary="000000000000d599e105bf850a1c" Subject: Required parameter after optional one From: benjamin.morel@gmail.com (Benjamin Morel) --000000000000d599e105bf850a1c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi internals, I'm wondering why PHP 8 started warning about required parameters declared after optional ones, when this version is the one that also introduced named parameters, which can take advantage of this: ``` function test($a =3D 1, $b) { echo $a, $b; } test(b: 2); ``` > Deprecated: Required parameter $b follows optional parameter $a in /in/DmhYG on line 3 > 12 https://3v4l.org/DmhYG If I'm not mistaken, the introduction of this warning (January 2020 ) predates the introduction of named parameters (May 2020 ), which could explain why it would have temporarily made sense to introduce this warning. Shouldn't it be removed now, that it makes IMO full sense with named parameters to have required and optional parameters at arbitrary positions? Thank you for your time, =E2=80=94 Benjamin --000000000000d599e105bf850a1c--