Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109012 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 77551 invoked from network); 14 Mar 2020 16:46:18 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 14 Mar 2020 16:46:18 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 541ED1804D8 for ; Sat, 14 Mar 2020 08:08:14 -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-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (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 08:08:13 -0700 (PDT) Received: by mail-ed1-f42.google.com with SMTP id h62so15876122edd.12 for ; Sat, 14 Mar 2020 08:08:13 -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 :cc; bh=s5eDiniOC5yHrRJiGiadGFILFS7Gdh3E7CDZbQgjC+8=; b=a968BAuxfL+tCTj0SAYV52ZtkqM+yDChl0J2J5n0m2qHfk3V/HY8fF1v8s5rqs/Vhj hDpHjS0+SMWIWldgYysLVLHtXvvYhGhyCwx29SiO81g9N0mxD3xu+fQwAGG8HsCOIKFW wmzIxlYqQKVidHWjb41DruurhEodzXXU9E15+e+AkrwlgJXzqq4GdQa/FC5ScCf8LWnq u1mMJqk3Vb0WFI1WK1vFzpwTCQ/s0D61uDF7pXug2on+WNe/EWrUimx69bgbTU1MOMgD XyQjtLWEGLYFdm0vZhjP0ZOGGJ+gCFzVg20nyQhZ6t0sIZQtmoyhahd1zdoNxZFjXN2T krBw== 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=s5eDiniOC5yHrRJiGiadGFILFS7Gdh3E7CDZbQgjC+8=; b=RYsLs1lRCKkNPd1hJahL++XvhZ5L3zG53r3Sc4iipb9SMVVjzO2i9F/VvG5d1+Ob27 /TzJXFSiLWZi7J/RmR1ZPRMkpRQdFo/S4l5EEbPuouG1t6M6JWZGoIckc/bwsHbRm4Z/ Pf24bMBReiGexqmK/b9knxboATxBKVwa0yCnSmCSGQ19eps1fTlGPXDsgTatijhr8nD0 ccTrKoPbdYMtBJ89fUAII6vYIDsq581z36VxeEM95VfGr1ydIElnczqIBfvlKCEy15D/ VVxmol0dgFVIUYzUrwQ2P7Pew0AFPKadqn7jcQGW6CR2qGrV24jED8JWwVNIpuAKifEJ MYYg== X-Gm-Message-State: ANhLgQ3U2fL+S/q0Y6Khinx2W8zmRt+fqF6As586B1pC+vRHpnYBIcSx zzOq6JIcRvno8IuVYY9M9T0n/3VvVAAuPzdSU2U= X-Google-Smtp-Source: ADFU+vvPxioNf1AI1l0lFZkJfGR+hvBVRH6bFdzTQ5exiN2OLteWSMx2sZtjo51cpShuU1GuRMI9lGU98/v7XqPrzKM= X-Received: by 2002:a17:906:9405:: with SMTP id q5mr15845475ejx.317.1584198491540; Sat, 14 Mar 2020 08:08:11 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Sat, 14 Mar 2020 16:07:59 +0100 Message-ID: To: =?UTF-8?Q?Midori_Ko=C3=A7ak?= Cc: PHP Internals Content-Type: multipart/alternative; boundary="0000000000005794f905a0d1f47e" Subject: Re: [PHP-DEV] Associated Arrays as function parameters From: george.banyard@gmail.com ("G. P. B.") --0000000000005794f905a0d1f47e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, 14 Mar 2020 at 15:43, Midori Ko=C3=A7ak wrote: > Dear Internals, > > I would like to as you a question. I know that it is possible to use an > array to function parameters like: function(...array); But this method is > not working when the array is associative. > > Would not be fine if an array like ['param1'=3D>'value', 'param2' =3D> 'v= alue'] > would be used in a function like function(param1, param2) regardless of t= he > order? > > I think it would make our lives is easier. I'd be also happy if you know = if > there is more effective method to achieve the same result. > > Thanks, > Midori > 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) On a side note, I don't think this feature is *that* useful and if you get to the point where you want to know which value you are passing to which argument it seems, to me, that the function is having too many arguments. Also IDEs exist and can tell you the name of the argument. Best regards George P. Banyard --0000000000005794f905a0d1f47e--