Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120519 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 68126 invoked from network); 4 Jun 2023 11:06:14 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 4 Jun 2023 11:06:14 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9089A1804F5 for ; Sun, 4 Jun 2023 04:06:10 -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.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_SOFTFAIL,STOX_BOUND_090909_B,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS36483 23.83.208.0/21 X-Spam-Virus: No X-Envelope-From: Received: from bird.elm.relay.mailchannels.net (bird.elm.relay.mailchannels.net [23.83.212.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 4 Jun 2023 04:06:09 -0700 (PDT) X-Sender-Id: a2hosting|x-authuser|juliette@adviesenzo.nl Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 77D968C126F for ; Sun, 4 Jun 2023 11:06:08 +0000 (UTC) Received: from nl1-ss105.a2hosting.com (unknown [127.0.0.6]) (Authenticated sender: a2hosting) by relay.mailchannels.net (Postfix) with ESMTPA id 7084B8C1C8C for ; Sun, 4 Jun 2023 11:06:07 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1685876767; a=rsa-sha256; cv=none; b=3m/p2nuzomD8xctsa1D94mH8ZX2DWhSpMuttZHxLdryQXjqcluXdtWfSG8YvrXI3Hqt86/ XUwDejSRH0s0JMj98dSjNeGYXdmGo0xuvJ2/CdfzPtF+onRIYu0B1Pp6wceHerxeLeMRLg Sb21TLT3bqdHk6XLTtJNwFNv72cLUhuIX+dElNwqQ3z3nZeCVxpjWIVjAwCkBs8S9Y86yG MLtFiVwJlKrV/ibVfGVe/sO65ZuXXDjL1yJ5Hi5S8ekb5l8p2+iFj7I2avEbaaPVj8uD6/ 36ehojPakuOastskYXtV+m+ieChH5v9rcAjCxgdlx/HUKt27aFhp7ULceaFz6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1685876767; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:dkim-signature; bh=mGZSd5Ql6BkKJtVcVXtk4ailE5NeFDQed9TF2Al0wYM=; b=K3H1GGOogePCKkarypLxJDbTuxoergRPjptqYblVn9yiu9kjzNoM3m/zMn0dtCcKJOJqGt tUoJBw94Z2/2sEc12prGG+uK8vU1sm0Fx3fIlio1NG5DUOe2c8mBm2YKCif6ijaQLA+Suc 3NOBX9paIrBjBPqqLfBw1Iu8SAxOdu+a1IC2DVlDcLcHOT+ksuh3M2Gwrtd6ix0gcWCdMf I5sBGoP1sMYYZmMeD344N5pgF9v7oTL6jAM2Mz5lKknyxyJatU9xrh+HnfZyw9lqmaFf7y sHhHfBSsxRQEkc8oAl4fdfuUfDFyp6bFj/9TD3dPFcwAlETLtVkmNkIHTg9UIQ== ARC-Authentication-Results: i=1; rspamd-5f966895c-tw8gq; auth=pass smtp.auth=a2hosting smtp.mailfrom=php-internals_nospam@adviesenzo.nl X-Sender-Id: a2hosting|x-authuser|juliette@adviesenzo.nl X-MC-Relay: Neutral X-MailChannels-SenderId: a2hosting|x-authuser|juliette@adviesenzo.nl X-MailChannels-Auth-Id: a2hosting X-Drop-Bubble: 3882d281188a2103_1685876767993_1327198371 X-MC-Loop-Signature: 1685876767993:3632748670 X-MC-Ingress-Time: 1685876767992 Received: from nl1-ss105.a2hosting.com (nl1-ss105.a2hosting.com [85.187.142.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.106.146.245 (trex/6.8.1); Sun, 04 Jun 2023 11:06:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=adviesenzo.nl; s=default; h=Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=mGZSd5Ql6BkKJtVcVXtk4ailE5NeFDQed9TF2Al0wYM=; b=AWCd4xPwZv5MzFEdJvdaveSxTI eJY9UwNuUMK+SU0rrmkBUZCyT8Ylj4HHD3yCxIyzEZW6UJF+RgyA9AjkrzlFAi4Yl18p3ejzai3cf 4ki/bg9L+tGKUrmrp28W8B5xRJ79e4Vt0jqfJRO7+ylnq70ePo83/KgwhzLwEXpPOVbc=; Received: from 86-154-178-143.ftth.glasoperator.nl ([143.178.154.86]:59445 helo=[192.168.1.104]) by nl1-ss105.a2hosting.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1q5lYj-007tcz-1c for internals@lists.php.net; Sun, 04 Jun 2023 13:06:05 +0200 To: internals@lists.php.net References: Message-ID: <647C701E.8030104@adviesenzo.nl> Date: Sun, 4 Jun 2023 13:06:06 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------040403000504010000050105" X-AuthUser: juliette@adviesenzo.nl Subject: Re: [PHP-DEV] RFC [Discussion]: Closure self-reference From: php-internals_nospam@adviesenzo.nl (Juliette Reinders Folmer) --------------040403000504010000050105 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 3-6-2023 21:11, Dan Ackroyd wrote: > Hi internals, > > I'm now opening the discussion for the Closure self-reference RFC: > https://wiki.php.net/rfc/closure_self_reference > > This was previously discussed as a draft here: > https://externals.io/message/112216#112216 > > Thank-you to KapitanOczywisty for the implementation. > > cheers > Dan > Ack > Hi Dan, When I read the RFC, I keep wondering why new syntax is needed for this. Isn't this a solved problem with the solution being "use a named function" ? Might I suggest to expand the RFC to answer all or at least some of the below questions ? * Why is a recursive function call something which should be supported at the language level for closures ? * Was the pre-existing syntax available to solve this - named functions - considered ? * Why is using named functions not considered a valid solution by the RFC proposers ? As for the syntax choice: it seems like the proposed choice is largely arbitrary and personal to the authors to go for a "languagesy" syntax. * Was any research done on how frequently this is expected to be used ? * If so, does that frequency justify the need for a change at the language level ? * Was any research done to find out syntax preferences from anyone other than the authors ? * Was the impact of introducing (yet another) syntax level change on static analysis tools considered ? As a co-maintainer of a static analysis tool, I would have a strong preference for either `__CLOSURE__` or a static function on the Closure class as that would make the syntax "isolated" to this change, while an `as $fn` syntax change would mean that any analysis of the `as` keyword and a lot of analysis of variables will need to be adjusted to allow for this new syntax. Not necessarily a reason to change the proposal, but possibly something to consider. Either way, my two pennies for whatever they are worth. Smile, Juliette --------------040403000504010000050105--