Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129779 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 lists.php.net (Postfix) with ESMTPS id 8B5111A00BC for ; Sun, 18 Jan 2026 12:28:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1768739310; bh=u7u7FHjVercEqd90poOD85bHM23lCyauMBOSNyYG1+g=; h=Date:Subject:To:References:From:In-Reply-To:From; b=TNIGEsiSkRBXCBvgXw0MxDxyObRZ+IIUnlcfc2UW+LPeRU+mXA0LU80+M6EXAAiT/ Gt7Pq1443P8JypguzT4VfdNRHsD+6OGlAkLZlxETzulCu2qZeYONTRBUazkzNnxVqA 0jY0P9HwK+JD4l5aMOCDEtxeJSqWNDGJjtMJaWDg5yx1+cpdjSwPyj6wlutWC3GxSs HZ+kRW+ZLjti9aYDIpXTd3mDLt1FjSZo/aWvUxKpIqEA0m2kYkfFvtnvJz3D/0Wdz+ csnqsJ5uM44CYSbjrzhCnKZgpsz5btPuWsVZZaFkQc1m8zfBSZD5EDaHXtM+xoHVs2 WwgjAJzijmZKw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9E1651806AB for ; Sun, 18 Jan 2026 12:28:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) 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.1 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 ; Sun, 18 Jan 2026 12:28:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1768739303; bh=MtQdlO0s92d1+WbJy1BKLA43H6T9QyVPLkGW+PakwgA=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=X0Y1qvtGjsc5yylbYzrhRpl8i5IailUsvUX9TrGNxCqF0LrrGg88FBTvT8L9SHbhM k0YUlZ5i0NZi5NFfSnk89a2DvrhbvFsvqrdCMh7jzz6WCILVCQcc0R9eE8Qh8sAz4K oxpuRRYK9TepPUpkafwifqP6cnGEALerCt+XBqSPJIj5yU9SC9xexS8KQvHVNwvQox oKX/isMsIhWpMxsf1WOTLlyodyoWT9bPWgxf+yrqLAbYC5dTusnBXUMxhUCv1DvcZc o4RKwgsjPt1hmCl15WgYI4+a8jSTTaknfymG19Uct3mR+AB6SkxYmTOjCIQasbhhNg q5EjMvHS47clg== Message-ID: Date: Sun, 18 Jan 2026 13:28:22 +0100 Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Subject: Re: [PHP-DEV] [php-src] PR #20903: GH-10497 (const obj->prop write) - language change notes To: Khaled Alam , PHP internals References: Content-Language: en-US In-Reply-To: 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 On 1/15/26 07:36, Khaled Alam wrote: > A potentially surprising case: some newly-valid writes can be a no-op > when they target a temporary const value, e.g. > - const X = [1,2,3]; X[] = 4; > - const Y = ['a' => 1]; Y['b'] = 2; > > These become valid syntax but have no effect because the write happens on a > temporary basis. > > Feedback on semantics + expected behavior for the temporary-write case is > appreciated. This is too unexpected / error-prone for me. Trying to write into arrays should remain disallowed / an Error, since this is never (?) useful. For objects, I don't have a strong opinion, but I expect objects in constants to be so rare that it probably isn't worth it to make a change at all. Best regards Tim Düsterhus