Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127003 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 47A281A00BC for ; Tue, 1 Apr 2025 10:40:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1743503861; bh=oGQ8l++DNJIFwrNHH0pllmlFRAs9W7QDx/5dDWkVCXc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=XaDR8fVxDRAfx0L8XnibP1WnD1IbtX5X8iZ8okMZ0oZ/h0LL9tbNZxd1sOVcD8Wsx eo73tZ7oT6r9WnUWXWwTMpl2vZ/ONX9qKHT672AV+bBzUh9V2X4VTySOR11+nb/o3I zoKCsGcnUkCmR59h00TzpaZQ4LvEJj12/7W5JE2eBnwkeCqVo/yQscxroTEvl8rm3a 2RCikJnBWUq0oXqG8MgfUKLWjGGLrIK7F5eoy/4ll7wGOlJSvip4D/C5lFKaiJaao4 8Z4gxD4fpPwJpzI1u2B8kvSPmTeGE+8/3VZWd+KsyFNwuasbWwn9KUZfn+BSrW4zrH S4wepgLGtJuVg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7FDF318004B for ; Tue, 1 Apr 2025 10:37:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 1 Apr 2025 10:37:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1743504005; bh=8rKdSDzEHZ1JBDsA/hY5TG9xxBVGqJh+nhWnSkdcryg=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type:from:to:cc:subject:message-id; b=dtEl7qSTtmpVIgqgXFXQdyGZItEaKtvNvTB3SkBlor0UgU17/FefvUzeqgaQIf/5r e5N18TM94DMImjQKXE4yckcnn0OahBSVkNKekO+u+dEs0CpuypBmZ1igul93qR9H5l ER0Mr8LZinLFyK4xEWaxpQX7Gu6t+OhzulJ6C9LjdFwHnjv6bh1enhJXAxXgLCOun9 5QWQbILNTrkxz5NyvKeQYQmQb6XBcw7E4dXpsDiWIQVlIDXT14Ftob6Dz6Y5P5j87Z zXXW7+13QEp3e12qa6lJ1M/+5RNvjOk0c2+F8sIiZbdJLGdf/+eFGY1Ax6TfL/DxSw xf50SwcG5DV9A== Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Tue, 01 Apr 2025 12:40:05 +0200 To: Morgan Cc: internals@lists.php.net Subject: Re: [PHP-DEV] Closure::getCurrent() for recursion In-Reply-To: References: <7ec4933d-0b9e-4c5a-bdb3-6a1a93c5ca62@varteg.nz> Message-ID: <87293ebfb73c8842e9aea2192df687e2@bastelstu.be> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi Am 2025-04-01 12:32, schrieb Morgan: > This is just as effective as it would be for any use()d variable, so > why do we have use() again? If you are at the point where you need mutually recursive closures, perhaps you should just use named functions / an anonymous class. I don't find it useful to “optimize DX” for that case, since self-recursive Closures are already somewhat questionable / rarely used (though I think I've used that myself a handful of times in the past). Best regards Tim Düsterhus