Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115269 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 5925 invoked from network); 1 Jul 2021 16:42:40 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 1 Jul 2021 16:42:40 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1706E1804DF for ; Thu, 1 Jul 2021 10:03:13 -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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com [209.85.210.45]) (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, 1 Jul 2021 10:03:12 -0700 (PDT) Received: by mail-ot1-f45.google.com with SMTP id 7-20020a9d0d070000b0290439abcef697so7239195oti.2 for ; Thu, 01 Jul 2021 10:03:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ralphschindler-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Z9ur69mEaU423y8Sek3Y4SV/ASij3Pj6loCKNNB6RX8=; b=Z4LLPjOUgGWIfBcaKiuz9TeqIDdcWUxM90Lo9hc+VKeEjHqbeo7uGNsOHVJGhU0C4S G62uxzv+ZD8I80dCZ0+V2UWOknWglfO0eAcVQHCSMEzvJ4UnraqjzqsaVUvDO6gUz3jP nOx70FrGZTI2ZV/vRJPsK7HnMCdJsTyfq9OEVeb0sICfXSdLCvt2S2BDvxhuOEzI4ITZ 0a2e25w2rcK8D8nehZtd71MRbpCAdyRGz7Dy2k4DHnQyj2+6gWJ5nlxbnEHc5Ysox1Hw sa73mBxwZCVXFFUfSaXRusXfslc7zpKrxhZtSBg947xADv/tJH6Y1qyjZvGAJy8+LUyP MiuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Z9ur69mEaU423y8Sek3Y4SV/ASij3Pj6loCKNNB6RX8=; b=g3eP7L+3mVDBYkDVY1MDvWVkUTwPz94+Pkbu2vGAE8FhsZ7TZE/3cEhPjuj3JXROJc RmC4HYQmqZ66Par65y8r+ejkTn6nmF1+Wzd0hRHqP8OAggJlm1vGSrz6LcNErjdPuU4q Sk25w9OcJrxx8oM49TuJwSFSOy4DO4GrOKpYfU1KD25Mwk9GsJoIfQ0UxWtK0Da0wXYT H5EIHyXdhDXiRImx1tomKmwXBo7EJ04HN/u8Pm3jiz02w0snPi60pp5DW22/Y4gv1xap kjx5nhnvu1Ghmaqvp8heztQG7pYf/wCWtEGIlanpNP0KQpoVMAxgEt5lcKYifrK1Pdt9 vTrw== X-Gm-Message-State: AOAM531v6IJXBBYA8Sn913LmFCTI1a8yBvSUpzptqcGHicd8SO/eRCmr ZVjKEcgaif+UOSZD/nBc9P2loA== X-Google-Smtp-Source: ABdhPJzcTqzn1Y84pKOfcvNnlDtxwq6NnZloEBej28W8LQYsuH9hghrT7MY63qM2a6X7zmElwPdxww== X-Received: by 2002:a9d:634d:: with SMTP id y13mr833781otk.294.1625158991932; Thu, 01 Jul 2021 10:03:11 -0700 (PDT) Received: from Ralphs-ZiffBook-Pro.local (ip72-204-153-233.no.no.cox.net. [72.204.153.233]) by smtp.gmail.com with ESMTPSA id p18sm53355oth.60.2021.07.01.10.03.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Jul 2021 10:03:11 -0700 (PDT) To: PHP internals Cc: Claude Pache References: <1ae611cb-b077-3db0-3237-c7ffa1c6e745@ralphschindler.com> <51A66F1F-F7AC-4D2A-A142-6BAB4471721C@gmail.com> Message-ID: <5d4f9f33-e9a1-a167-766a-de70015efe23@ralphschindler.com> Date: Thu, 1 Jul 2021 12:03:10 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <51A66F1F-F7AC-4D2A-A142-6BAB4471721C@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [Proposal] call_user_func_map(): flexible named parameter mapping for call_user_func* From: ralph@ralphschindler.com (Ralph Schindler) > If you want to ignore arguments in excess, your function may have a rest parameter collecting them. The following will run without error: > > ```php > function foo($c, $a, ...$unused) { > var_dump($a, $c); > } > > $args = [ > 'a' => 'the a value' > , 'b' => 'the b value' > , 'c' => 'the c value' > ]; > > foo(...$args); > ``` This seems like a fairly clean alternative syntax with the only downside is an unused variable. Thanks for the idea! -ralph