Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114543 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 65464 invoked from network); 20 May 2021 18:07:12 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 May 2021 18:07:12 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 400FC1804F4 for ; Thu, 20 May 2021 11:17:17 -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-Virus: No X-Envelope-From: Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) (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, 20 May 2021 11:17:16 -0700 (PDT) Received: by mail-ed1-f54.google.com with SMTP id j10so2965387edw.8 for ; Thu, 20 May 2021 11:17:16 -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=U9c57YFNzcfmoKWthAm0qFJ8qTD83Dl7OCFsBWKLDvQ=; b=VTYEzwEBxSI/0B4lNZTQZNVluHxs5XvCsb0Nzen97Ti2qi77YBO6aOi9fWG0gQtGCm yxZre9JwNYr9Giic9b4yNOsrbLER0a4pjCKgkLC4oqJWKlOescaW/9CV8F6LqQQb0eSD Qk6YQJo4nH3Vlq+Vx3bVD/upETF4Mqnp/QPj1M4Br+3xkBfwo2VkgJxQ2nEeu2eEA5ss LNs8hPGPS8k1wcM9ghiW7SbZI+z2vPOAeFCQiCRu48QAeH8PlhIXa3/6w5P029KlJ9ug EgDUiq9bl+dtzBcF39fwluwJPPQMCG0upnbuQJAB8+bLKG6VhW6iheWSGfLQRGYclx7Y llKg== 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=U9c57YFNzcfmoKWthAm0qFJ8qTD83Dl7OCFsBWKLDvQ=; b=PhgiJmCK/J1L3fPJ7QpFtIyinxj9h81JJxdcYEO6bQJYEkaN4sk/OJuY5PEi0IeW6r dqlFTaKsSzqpqIRMZKUcoWVw2Oi832RX8L13lEn2YLWOL2LLt4wSfU9Xz6vHYE55TJ/7 ogvvbm/tnvmxD1BgP4yBHn+zOOh5yj2Y4SJOngjRlBLrMIJ9wUxKOgpQ7nJ4OhCP5c2o e67RwYRlEawXObRol5p3f1KYNq8fOmi9judrFLEgSTfuqSCrnbkxmKg6ApxZPideGAua KtUAFWZ7tr6VmaYrGIi6PxHn5IsYT2ujDwZeCxZZdnnjRuMnSp1R/gIwupsJLGgVKXx9 vhpQ== X-Gm-Message-State: AOAM530uuzooaob5ZgGw7o0KjmQroujoWimUFbOc6zvAp7BXtpUWGypZ gmPVSz5NnxOVcO2yJJ1oIJMJmqP0NmLRxMCKHh8fkyVtiwI= X-Google-Smtp-Source: ABdhPJw03QFmaj5VGDW69ds73Bn9aoNV+Eu/Sc0yuG+Lg8rQ9nqXTWgcRZo96xSW8UULa3XH5+K8HqG8IFaBYg/Uo9Y= X-Received: by 2002:aa7:d607:: with SMTP id c7mr6245011edr.255.1621534632675; Thu, 20 May 2021 11:17:12 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 20 May 2021 21:16:59 +0300 Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000c58d5a05c2c6f388" Subject: Re: [PHP-DEV] [RFC] First-class callable syntax From: drealecs@gmail.com (=?UTF-8?Q?Alexandru_P=C4=83tr=C4=83nescu?=) --000000000000c58d5a05c2c6f388 Content-Type: text/plain; charset="UTF-8" On Thu, May 20, 2021, 15:48 Nikita Popov wrote: > Hi internals, > > I'd like to present an RFC for a first-class callable syntax, which is > intended as a simpler alternative to the partial function application (PFA) > proposal: > > https://wiki.php.net/rfc/first_class_callable_syntax > > This looks good to me. Following some discussions, I understand how this syntax was proposed. Maybe update also the PFA RFC to be up to date with the latest info. Also, considering the resolution between property and method (or between constants and static methods) , it's clear that we need a syntax that looks like the usual invocation:(...), or (?), (...?), ($), ($$), (...$) etc. I have few question related to some behavior. If we have closure: $c = function() {}; Will this be true? $c(...) === $c; similarly with how it happens for Closure::fromCallable($c) === $c; since the RFC makes a lot of comparisons between them. Also, from performance point of view, do we expect the new syntax to behave similarly? And another not practical one: Will this be valid? $c(...)(...)(...)(...)(); Regards, Alex --000000000000c58d5a05c2c6f388--