Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109018 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 39513 invoked from network); 14 Mar 2020 20:52:09 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 14 Mar 2020 20:52:09 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7AECF1804AB for ; Sat, 14 Mar 2020 12:14:06 -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, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 ; Sat, 14 Mar 2020 12:14:06 -0700 (PDT) Received: by mail-wm1-f47.google.com with SMTP id f7so13751263wml.4 for ; Sat, 14 Mar 2020 12:14:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=M4h3XhFT96QU2BoqIOj6PGSmGOhNREQS6hnNb4H6lM8=; b=mvmLWw/KoQi/ISntV8UzFv+ejOvaxAes3pRWNp/zaYiua7AWptCnqeiE2CTpLn5Kbk tY4yestP8thHRGcuPaiiYnSLVQXFSqrRhb56HJVRau4EQqsTcgbFvnDZiBneXDYf0ewB n//9gCSw/YZElj27fw4Wp1D6rmnQRzKYb7quSs2yrLgu1luJRcfmhopoCApcH/MBlb3t s8oct/A1OkSfSfef+7NdbC9ygGvbHYRT6+Nb//kJmRbPtUzOQFTuQFCZZThJNumz7ugC uqJPvYKu25TNNQPnjgrxXCqI9LbAg2O1lR7qULPO6gM+gXB/aJzOGbeGd70L4vZgw4PV FUdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=M4h3XhFT96QU2BoqIOj6PGSmGOhNREQS6hnNb4H6lM8=; b=PHh89FlRh/HYciBNPWA5DzIaSZUQ9mrYdvOyUhPknfUn5JdT3KTIU3hjifaY5IdZsi qmC4xWFn1uCVl9Gm0FfknI+PpP1hzK1rZGkexGkizYkR7vGL8G5rOmRNxPNEdbftUU75 hHb88lEYs2dzcyBiXUbjuGo5/ic0NC2YiZ+k9bWNtLY9w0jwEFS3IGF3OJHIqh5W1w5L 6GcGW7SOozhnUteMPk9QuQ66arI/53XQ16/ac4XeKDbql/gH5OMlTNV9lyImS2Ik6inf dJlZ5YsPNP/G5+C+AzBN0He1gloiclkyDmgW/B437Rdvr1ZOzD6anTqUcclEcNooffTm iejA== X-Gm-Message-State: ANhLgQ2LedTGm2hbOQc3G9lsr1uYW4WYmQ354YqexBXuUUuJHWL91+wR cn6uOKXfT1hfAxk9fRoALFy3c/p4 X-Google-Smtp-Source: ADFU+vuVfZ4R7qdHEo2h0h4343ftLEaEqCOBHsagN0MfzlzjoQn7FF56AXRrJvnx47zj2jfvskulug== X-Received: by 2002:a1c:208a:: with SMTP id g132mr16978920wmg.44.1584213241411; Sat, 14 Mar 2020 12:14:01 -0700 (PDT) Received: from [192.168.0.14] (cpc84253-brig22-2-0-cust114.3-3.cable.virginm.net. [81.108.141.115]) by smtp.googlemail.com with ESMTPSA id w1sm20892243wmc.11.2020.03.14.12.14.00 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 14 Mar 2020 12:14:00 -0700 (PDT) To: internals@lists.php.net References: Message-ID: <46536651-3d34-11fc-db21-f3cccbbf9b3d@gmail.com> Date: Sat, 14 Mar 2020 19:13:58 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB Subject: Re: [PHP-DEV] Associated Arrays as function parameters From: rowan.collins@gmail.com (Rowan Tommins) On 14/03/2020 15:57, Mike Schinkel wrote: >> What you are looking for are Named Parameters, there have been multiple >> RFCs about which have all been more or less abandoned from what I see. >> https://wiki.php.net/rfc/namedparameters (From 2012) >> https://wiki.php.net/rfc/named_params (From 2013) >> https://wiki.php.net/rfc/simplified_named_params (From 2016) > Can anyone summarize why these did not move forward? Without digging back into the archives, my memory is that points of discussion included: - The choice of syntax. - Support for internal functions, which don't declare parameters in the same way. I believe this is now solved, or at least vastly improved, by providing reflection information for internal functions via PHP-syntax stubs (see https://externals.io/message/105851 and https://externals.io/message/105970). - Handling of inheritance: what happens if a class overrides a base method (or implements an interface method) but uses different parameter names? If all parameters are immediately accessible by name (i.e. no extra opt-in is needed in the definition), there will be a large amount of existing code which would immediately break LSP this way. - Mixing named and positional parameters in a single function call. - Handling of variadics, both the function foo(...$args) syntax and the special func_get_args() etc functions - Behaviour when a non-optional parameter is skipped (all three RFCs predate https://wiki.php.net/rfc/too_few_args) Regards, -- Rowan Tommins (né Collins) [IMSoP]