Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110814 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 98916 invoked from network); 2 Jul 2020 11:46:34 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 2 Jul 2020 11:46:34 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 97BE51804DC for ; Thu, 2 Jul 2020 03:35:58 -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-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) (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, 2 Jul 2020 03:35:58 -0700 (PDT) Received: by mail-lj1-f179.google.com with SMTP id h19so31219219ljg.13 for ; Thu, 02 Jul 2020 03:35:58 -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=38krDVKfYOFuA4xqzIkqT3HhI9zUUz9pLjKad70juxo=; b=IAUeZHjqqR7eGPCaCsnjHraud7oWOkmXggm4JdAS8TSZfeGiZe8HpSgnQSVbRDa1t5 +/L4/v/H8XxPFqx/DEhnOZFptJrKZqdpFoqHsvNL97L60Nzf551mLasBF2TLg2FBXhnp zSJ2j3AxQGYDacoTXYCF/WiUY9ofYWGRKqZoctngwbcSQxxv4uK606Cx6ElQC55bqOmd gP22v6y67iMwRntZQ/r4I8OUYISrz5Jvyd6SDMySfuRXwvs0bqvfRhG0P22jh9Bdc0ux yoxtmvkyN/uQ3GMQLltfwzUqqFCPqFW7tkgPp2xHo+jDnGBrYQeo/7uQfEXMISOm/7C5 uOYQ== 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=38krDVKfYOFuA4xqzIkqT3HhI9zUUz9pLjKad70juxo=; b=O0TGUsaSdQSQCOzGJJ16TiXVy9CNQGfmwnjFAitepZixLQB9L3dBwCk7Tv6KKQaRV+ NvWqt42aNDFhL2pM6XUCWKOkGv9+WxaLxsAGV5YuJWnINh03HWYHh/GkqaqRhQeAWCkA UxREpDbG6dkBTmPjD4b1D2pETA60ySu1Vg63+5Wztv03o/WTmDiexuZdeHUab8s4Z2MK scTalectAjgZsbbWapdB8dnRCmD+fDbSmTPKaB52lnjNFyw2RwSAUhOCoEDwvyzYjGSN 6yperUagdGERjiYuU34mE4P3h3r7sPcmMenYz/jkdxTwRvTrLOJZ5VmkmAbhe1YkS5UQ dCGA== X-Gm-Message-State: AOAM532fl2LYkRlVZys8fgX90S0wN233/26y9YY4ZX/hgj52GGvWOSO1 0HvZLFFGI89x84hY+47b03Sjt6X/l7FSgPWtchYS0k+M X-Google-Smtp-Source: ABdhPJykjojaKX6muJDR0V0F+4gNv7+tE3sOxoqO+Ym63fWvK4HrPZ/YEabz5UfFsKK4PzxnoyJ3My4KbLtIA+T9SdI= X-Received: by 2002:a2e:850b:: with SMTP id j11mr16328919lji.30.1593686150525; Thu, 02 Jul 2020 03:35:50 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 2 Jul 2020 12:35:34 +0200 Message-ID: To: Dan Ackroyd Cc: Larry Garfield , php internals Content-Type: multipart/alternative; boundary="000000000000e2b7bf05a972f888" Subject: Re: [PHP-DEV] Draft RFC callable types + callable type/function autoloading From: nikita.ppv@gmail.com (Nikita Popov) --000000000000e2b7bf05a972f888 Content-Type: text/plain; charset="UTF-8" On Thu, Jul 2, 2020 at 12:26 PM Dan Ackroyd wrote: > On Wed, 1 Jul 2020 at 20:40, Larry Garfield > wrote: > > > it would also offer a way to do effectively the same thing > > One use-case that would need to be covered for that would be for > callables where you don't know how many parameters there would be in > the callable. > > > duplicate functionality needlessly. > > Good chance it might still be nice. Not only is the syntax a little > bit nicer imo: > > // For some class > class Foo { > public static function quux() { > echo "I am quux"; > } > } > > // Partial version > [Foo::class, 'quux'](?); > > // Dedicated version > $(Foo, quux); > > As I find it easier to read, but also avoiding using strings to > reference functions/classes is probably less ambiguous for both humans > and computers. > The partial function application version would be Foo::quux(?). That is, looks just like a normal call, but with placeholders. Your version would of course also work, but I'm not sure why someone would want to write it in that particular way :) Regards, Nikita --000000000000e2b7bf05a972f888--