Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115272 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 72371 invoked from network); 2 Jul 2021 04:45:09 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 2 Jul 2021 04:45:09 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 02D7C1804DF for ; Thu, 1 Jul 2021 22:05:48 -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,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com [209.85.160.171]) (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 22:05:47 -0700 (PDT) Received: by mail-qt1-f171.google.com with SMTP id g3so5811108qth.11 for ; Thu, 01 Jul 2021 22:05:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20150623.gappssmtp.com; s=20150623; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=AsmLacEqBBnVANZeh4MeDIm7xeYmcWeClG99eAGzSnQ=; b=E1sa7V6Q6QA5GA5SWfeVkDcMzQeNIjgQm09sFp/q+HilPdLCHn6ko/k2WCLZUszwOF sJF4XnTUJ6pqcyLEUsSfQGO9aEDLEH3D23Sov/nJrXHRaWTWBDgUcTprkG7+pcJpjhFm aiqlVP96QgcdW8F99E6BxQGlBlb/myFmsvQvW5be7F46dW/XufECcBTZfLnw2jQdzRl+ sGSVxj6JJhUo67bO7j3O05cEOQ+B46fEFqPqENU9VpLJ5NMEv8/1BSmYuxkNBH7Rpq1Q Veu2+qeBPL1EYVEJhbj4cAO+VQQTpUB3vV1Ed/RK7sGYLO+0Wt9oLVi9oSAJ/2hiHgbL IQ1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=AsmLacEqBBnVANZeh4MeDIm7xeYmcWeClG99eAGzSnQ=; b=le2zEpSerKRiraCcElcVXRqsezQdNs+qVdqv0lg/kVk2WqZF0qtHPAhgUaSg+MqoYw xj4bl+lZ9z5HgNzO9Vl2fZrZ+ivtO0uOZSoiYVsFBPrb9DLG8trb993822qeyuxhOCOu KpxKdEFha5A47Ll5MV+c9RcHreL+XOAwuUc1CE+M1k9R+dwVGSQJ/F1+VkSTXPQe7AwJ vzdcvQBZKnS3maz983PVrtMmo04v6sAaGHVWcyaZEsm0H4E6drGVYHc2ytsArabyu7uj iOxiXHubLOQc0iQiR9jYUviIgpwo0cIsVeksvD1GNTPoYa+j4YO1+o3URzbmE/4VU2h0 UFxg== X-Gm-Message-State: AOAM531QHGksBZD7zwNjxuwmusdQF0lLFPf12GqEfJkQQrTUCsyLTDiu s9Lq6BEV7as81BnVcE4TZIZk3A== X-Google-Smtp-Source: ABdhPJyc8dbkF8avtq4HfEXttvZRYh/skIqVmZNqMB0m42dPR4rWF6PyJvcKYmt1XpfrreJ4eUbmkw== X-Received: by 2002:ac8:71c6:: with SMTP id i6mr823016qtp.203.1625202346515; Thu, 01 Jul 2021 22:05:46 -0700 (PDT) Received: from [192.168.1.10] (c-24-98-254-8.hsd1.ga.comcast.net. [24.98.254.8]) by smtp.gmail.com with ESMTPSA id n83sm284315qke.101.2021.07.01.22.05.45 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Jul 2021 22:05:45 -0700 (PDT) Message-ID: Content-Type: multipart/alternative; boundary="Apple-Mail=_C0AE5F8B-EF8E-4A4E-9CA7-BA02313F60B1" Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Date: Fri, 2 Jul 2021 01:05:43 -0400 In-Reply-To: Cc: PHP internals To: Hossein Baghayi References: <1ae611cb-b077-3db0-3237-c7ffa1c6e745@ralphschindler.com> X-Mailer: Apple Mail (2.3608.120.23.2.7) Subject: Re: [PHP-DEV] [Proposal] call_user_func_map(): flexible named parameter mapping for call_user_func* From: mike@newclarity.net (Mike Schinkel) --Apple-Mail=_C0AE5F8B-EF8E-4A4E-9CA7-BA02313F60B1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Jul 2, 2021, at 12:30 AM, Hossein Baghayi = wrote: >=20 > Hello, >=20 > On Sun, 27 Jun 2021 at 19:09, Ralph Schindler = > wrote: >=20 >>=20 >> This proposes a method for a publisher/framework/producer (the caller = of >> the callback) to document all the parameters that are available as = named >> parameters, and subscribers/consumers (creator of the callback) could >> subscribe to what they need by name. >>=20 >=20 > Wouldn't it rather be nice if we had more detailed callable types = instead? > I mean instead of simply defining a parameter type as `callable` we = could > specifically define what the callable expects. >=20 > Something like this: > ``` > function bar ((int, string):bool $callback) {...} > ``` >=20 > A more generic approach that could be more descriptive, maybe. >=20 > I have no clue if this was already discussed in other threads or not. = And > whether it is feasible to implement. =46rom 2015 which failed (not sure why):=20 https://wiki.php.net/rfc/callable-types But I believe that would be better to be part of a broader ability to = define our own types, e.g. type function(int, string):bool IntStrFunc; function bar (intStrFunc $callback) {...} I think a few have mentioned user-defined types in the recent past but I = am not aware of it being a current RFC for it.=20 -Mike= --Apple-Mail=_C0AE5F8B-EF8E-4A4E-9CA7-BA02313F60B1--