Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115276 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 30437 invoked from network); 2 Jul 2021 16:11:12 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 2 Jul 2021 16:11:12 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8144F1804C8 for ; Fri, 2 Jul 2021 09:31:56 -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_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-oi1-f175.google.com (mail-oi1-f175.google.com [209.85.167.175]) (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 ; Fri, 2 Jul 2021 09:31:56 -0700 (PDT) Received: by mail-oi1-f175.google.com with SMTP id w127so11907224oig.12 for ; Fri, 02 Jul 2021 09:31:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ralphschindler-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=DpSveDW27KSwEZAlZm2d3a+MhSJa1003pX+ImfcEFH4=; b=w5i85n5LjpfAmUcD4D4Q9JEI8YQE1FfBo0eiS9OVmesB7cSMnzG0kpUlyDmlfaEyCv 4RIS7j7s7AIn4nIi22+pGkKh1hKqjg7huuS2XNDZ9ontBw6nqr4b6QEoFBcqKQyFqVUg uJ3wTM+5TS9vJ/sc4XZ4WwCoOw53QQyyFhsWLgBkNh/4XkDkbFuoAfnZ+K2f3HmOrQI3 Rgfqsz8wLMXa+Q+HgOkrOWn+MLJndn7HtcXY7AtV6dvKUzdU+eR0lQVtkzGiuOUImdiG p10moBe2cRJ6eU5NQcjUwc0vW/GJ8ZkrNpzFl/fK2ER9G1sniR/ywSlq2GHb44l6v8JA V/5w== 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-language :content-transfer-encoding; bh=DpSveDW27KSwEZAlZm2d3a+MhSJa1003pX+ImfcEFH4=; b=Z1HaMwYjluAApzyKKXuwAAXyF9vQc+c31yrLrCXA6UQZRIEfTB2Fd7a1y4F6PvJKU/ aQfS+f7W0djKB/6j4UbcVZPVMyfI3LWMUdBC/jcYfoXV7StVHBGY1ozAf/2h03m6Kxyz fnGyGzRcMfCUwPBxfpNcfjvD/3Qg2vZ32G86wojh60ZzpXJ3+hDLK0cGPJLzZTQS0y2+ FP2bKm1mCowghPjAHhYbEqoD5JH7+HWpBlbnYeKTt1vaZ08lP7FnmowRzZQadgTP2siY TSKs0x7T2+NuZ4R0qEc1dBcoc1YWQKAT/mOQSKWCeIBSYfbdS4iWzCCZ6aTA7sfQb2Kx XleA== X-Gm-Message-State: AOAM530oms1X88/b0JWT9MMMH/VP6EqpGD2ILhvReWV4qxCy7lI5PF0k DES6zY0NDadFV+cRAPhqpBmkJyTjUVdeZZh6 X-Google-Smtp-Source: ABdhPJwWpxXKrJTjkQpfJEtYqVVaHHKBcHlwDHng5F47TFRqt2M/M0NZmYpDcWkJ87q19GTmrG2Kvg== X-Received: by 2002:a54:408b:: with SMTP id i11mr499890oii.67.1625243515166; Fri, 02 Jul 2021 09:31:55 -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 g9sm685472otg.81.2021.07.02.09.31.54 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 02 Jul 2021 09:31:54 -0700 (PDT) To: internals@lists.php.net References: Message-ID: <802fdb7d-69e5-edfa-de94-70416f9093d0@ralphschindler.com> Date: Fri, 2 Jul 2021 11:31:53 -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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [VOTE] First-class callable syntax From: ralph@ralphschindler.com (Ralph Schindler) > This RFC uses a syntax that is forward-compatible with partial function > application. Should it not be accepted, I'll explore alternative syntax > possibilities. Given the choice of syntax in this proposal (which I do like)... Is the following (potentially future) use case precluded by the syntax (whether or not you like it immediately ;) )? Basically be able to: 1. be able to refer to an instance method statically (this is currently an error) 2. allow late binding of $this/context/closure scope, either via bindTo() or via Reflection setClosureThis() (does not exist) class MyController { public function myAction($name) { return new Response("Hello, $name"); } } // Closure with no $this (to be filled in later) $fn = MyController->myAction(...); $controller = new MyController; $response = ($fn->bindTo($controller))($params); -ralph