Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125902 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 0DF6A1A00BD for ; Mon, 4 Nov 2024 12:12:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1730722476; bh=kuTA+h8lXVqZDms8E1+kXOx2ibIypqOwzMYWzPNmHw4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=jHtkQEgeNWgncX/V/m0PnALCJgPPJ70dEh9HwqqLeWP99wwtCXDuCRKx562FKg7hM 2RxSS3fxw64reD5vOOaIBMMXOzAA2AJqmGx1yY30RwAqaEBYqFBOg8g7hhb8cYeNPw X6Q5FGfHyHuLrwycCZTbVdXFo8xaPq5UJzraf58+NTEbpyKGF2aotYVCGg3O4rHDm7 jYEShTrCgdbRRNGIwzJSARskGg5c6BLY8BwMEU4c/KJiBZlW61TCgWF5Pjiq/fTby3 gZn6iq+1zmNFE2j+YPq67Nppw2O1gv9lEUmIMbLX2leUbGZ+dgWGHUFWty8Rh47L+m mON1lB1t7xKkw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 538C118003F for ; Mon, 4 Nov 2024 12:14:36 +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.6 required=5.0 tests=BAYES_50,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 ; Mon, 4 Nov 2024 12:14:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1730722323; bh=222DmiSFeVKWxLcVXsSSqNq5Kd+zRQ56TteralwHuEw=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type:from:to:cc:subject:message-id; b=hvmsVZPBFicNaJ8MjJmkQ4qy/BigRKFHOLvM8lAXS7CqfC7+i0+X+VGRg0lkzfWF4 EU/w9YSqKfBaDjIAm5W9rl0NWUoZ/NJGFabAWW08dvppSNngYI4OjXMx/j5WQ53kMT 26Lp5ovD13WfU1TMuvUN3FtUVoHsw0/l/l/Bsw4QnJPcYVCTEIspLkHB/Xng4hiPt2 bjn/bCY0YnukTrLAe84kiUVLOqpQ7jKqRbVs03+huRpd6z5Kkop1y8kXm/pnuXavqJ /c9+DysHHegROh3NRPH9HI1EfJ0jj4voBIyW8+U2zpAj+XAKlP5dIjVG+Der3wKbkB al4zmtMHzVE2Q== Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Mon, 04 Nov 2024 13:12:03 +0100 To: Rob Landers Cc: internals@lists.php.net Subject: Re: [PHP-DEV] RFC: Support Closures in constant expressions In-Reply-To: References: <15da4c13445d7e9c9d768c60c19768d4@bastelstu.be> <3b458165-406c-4b70-97bc-6e98d6c44c72@app.fastmail.com> <6f39dce9e6b0579baa51bc84cb8140b9@bastelstu.be> Message-ID: <1d97078377e5c709892b96179ec608dd@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 2024-10-31 08:22, schrieb Rob Landers: > To be honest, I thought it was a rhetorical question since the example > is a runtime error (passing string to a function that takes an array), That clearly was a typo / copy-paste mistake / whatever you would like to call it. > but on this note, we already know how it should behave: > https://3v4l.org/RC6b3 because, as you said, it is captured by value The context was “can't we just pretend there’s nothing to capture in const-expr contexts”. The example was intended to point out how that will lead to semantic sadness. > In theory, to support this, we would probably need “late binding > constants” or constants that are executed just before any userland code > is run. Similar to just emulating it yourself: https://3v4l.org/PMY4W Yes, but see also my new reply to Larry (and the reply to Alex). Best regards Tim Düsterhus