Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125898 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 C594A1A00BD for ; Mon, 4 Nov 2024 11:48:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1730721085; bh=zWrhl0wvkOppwBUBvmCubYmIyiag2E7wkxx1Okq9pdQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=bxtEl3fohaK9VPw3nqV8DuUNvC2Xd/AOAcNupLwskRg20LDZx1xBnWIyyjjwR9vm+ 9sl0ZrU3gPNqcVptpH2Pt5MEHNP4tBjc/YWinHehbDljtTh8idebqsVvYoInIDbfBX jeDy9l1a/MW2Ol/hXCJbL1Krt8rZENbFe4mBOQy/WW7UVqLWI5LSedeC6snOD3Dt0D u6NGMAGwWbbvoocn+axAubGg7LaEbD5ox0PjoUFaDqhTWRF+KUeCDkP6NVBBSHXShv eTeENfLsigfKhjRtZR7jsvFCA3hZNFRDcu5vvYKxwokHktHVQJYbTpExySVPSl6XvY HBzy9O/Ni96Bg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0C0BB1801E8 for ; Mon, 4 Nov 2024 11:51:24 +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 11:51:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1730720929; bh=Fz65YejBdIGAuYhTiHbziLzpjTejgk8SWMplNwHc/qk=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type:from:to:cc:subject:message-id; b=QH8JyA2ZtRGcVWC8JAjphO+wR3Ya/187N+FZ4C24I2tlTBCnLf+YUbjrGvHtEbXI2 W1hq1zH6uCxiEmlaifuav/oKL3DAGcVAfAtM4yeRzCTIySylqR/vZJGfUwyA4VyzgY ywrNBhf4n7GwgCkGBDXwcaW7h9ozhTKwNDvnGQTwSmb53LMDaKZeW40i+NTVWsFCrW fmzNXQpXYLZ8iw5+bYhPVXbYfWgyP1TgqdsYnWXJHXXTQPagZKfMwZz4RR/S6tVOqy 5g8wEbu4VTMvFQ/QgAd7fxKcvyG2frn5wYtPpfgQO+1KqCd9Ef+DSlz92xM7/RcMHJ 82Z6++bTjShXQ== 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 12:48:49 +0100 To: Rob Landers Cc: internals@lists.php.net, volker@tideways-gmbh.com Subject: Re: [PHP-DEV] RFC: Support Closures in constant expressions In-Reply-To: <9681c714-4916-45cd-98ce-561ca8e89351@app.fastmail.com> References: <15da4c13445d7e9c9d768c60c19768d4@bastelstu.be> <9681c714-4916-45cd-98ce-561ca8e89351@app.fastmail.com> Message-ID: <46b83fabc3c7984744280c9b7d260328@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-30 13:06, schrieb Rob Landers: > This looks interesting, but I notice it says that the closure can > access “private properties”: > >> This means that Closures in property default values may access private >> properties, methods, and class constants of the class where they are >> defined > > I assume this means private *static* properties since it couldn’t be > attached/bound to a specific instance? (Must be static?) No: All properties. An object of the class could be passed as a parameter to the Closure and then the Closure would be able to access private properties of that object. See `Zend/tests/closure_const_expr/property_initializer_scope_001.phpt` in the PR for an example. Best regards Tim Düsterhus