Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110913 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 45169 invoked from network); 10 Jul 2020 11:20:11 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 Jul 2020 11:20:11 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 59CB118050A for ; Fri, 10 Jul 2020 03:11:35 -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-io1-f53.google.com (mail-io1-f53.google.com [209.85.166.53]) (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, 10 Jul 2020 03:11:34 -0700 (PDT) Received: by mail-io1-f53.google.com with SMTP id a12so5412764ion.13 for ; Fri, 10 Jul 2020 03:11:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=3F9HI/vM9Jz7yJKtyS/2ZjfGnOoU0O1ZgejPjSOj0Hs=; b=FaVNdKlg7/BRBKlr8NKVKRf5d6Mb0iGawLHtaX1o6iN09eLueQlQma8RMRL3WBhQRE HaOJ/eAMIGw+aIEA1thurjc8hjrvoNs35/SJey14DjxGtqwlJWOIAVNc2JvG19p4+hez zc+WlrWBdb+gZqr8C3ttM4/sPD/ih7BIDYAMnVgyKX0K2huBeNdDmDNCgXf8xIPqKs9Y fmRqRrFGI3EFcNydyCi+X3XlPcTZlEAm9FZHRr5YnrZG1i76dUmNDc+q6uFwWblNh2XQ IdCyg6T8P9puMj41pXQ3Kdj5WMjdgV5PmRYLqZ4ga+zJAmTepvyn4bcG4vr3u4FvDJgh nxgQ== 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; bh=3F9HI/vM9Jz7yJKtyS/2ZjfGnOoU0O1ZgejPjSOj0Hs=; b=GtHU6Dcqqz2jqg8229HusQGDCj1N1J/jFCCfXtv/OSlxLjmjiUX1w9T0u6eCVMRZOA b9uZo/ejPc8xQhWNm4AnjJcyo+/JUvrnnjxZ94FUq/le4XCbnPYKkLfxu3E+VtiqmHqO Rb3Xcb/S9EYfEdTz8bBc3Jvq2jr4aeRMfs9PxcUP8YguMKhurFPF0uJ/43YdbL82ySWB MGRJfhwvGX9yGMwX9YXTHw2/CsRHHgAkndwcZxBsSk071jxRQrK+RI9wEzPl3Jntok9z snNH6xtADwjGYr1rJH2RQlF+18t3o6A4e/7c4Nz7EDHj9oveY7xigvaHlDzZ8JJMXSt7 8kHw== X-Gm-Message-State: AOAM530+X0BnypVx4Lr20nec50at0HSmU3HmbvAU6TdB6TiA3/aQg9SU 8flml37CBucyQIEkbA/tRjn4SvPRwJblqMC1Ap2p0NbV X-Google-Smtp-Source: ABdhPJykwDIfgxgxt8HECIUvNOmuakP9MeokvomOfY0ov+9u83PQBBx/653k7/p9wp3tJF44kTLRhZt1pYwxwerUjqc= X-Received: by 2002:a05:6638:2591:: with SMTP id s17mr26025613jat.23.1594375891922; Fri, 10 Jul 2020 03:11:31 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 10 Jul 2020 11:11:19 +0100 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="000000000000ad328405aa13903a" Subject: Re: [PHP-DEV] [VOTE] Named arguments From: rowan.collins@gmail.com (Rowan Tommins) --000000000000ad328405aa13903a Content-Type: text/plain; charset="UTF-8" On Fri, 10 Jul 2020 at 10:21, Marco Pivetta wrote: > I kept my "NO" stance here, as per discussion in > https://externals.io/message/110004#110005, where I provided (in my > opinion) good/safe alternatives to arrays as input parameters. > For the record, I maintain my reaction from https://externals.io/message/110004#110010 that the example you give "cheats" by including a "fromArray" method which simply emulates named parameters, but without any assistance from the language would require a large amount of boiler-plate to do so. Would you be more open to a version of the feature that was opt-in at the definition site? Then your example could swap the hand-rolled documentation and validation in "fromArray" for a fully typed signature in "fromNamedParams", and the only compatibility promises would be ones already made by "fromArray" anyway. Regards, -- Rowan Tommins [IMSoP] --000000000000ad328405aa13903a--