Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130157 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 0D40D1A00BC for ; Tue, 24 Feb 2026 19:32:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1771961556; bh=Lop/ADllYEWanfc/FkluCvrPNE+L5lcfXQMDcj4c+4M=; h=Date:From:To:In-Reply-To:References:Subject:From; b=Tx3iQOT+BK3otYBWybdUCcfIxqzh6aPbWIWw/jEmC+vjXh9A3FnKtvawWUTfINC9r QrZvoNPdHO7y9xBBb54y/XGMk5Rs6se1DqRXDayXb3wg90Q+8dKNJQnne1hfPifmcc iBGAqFvr15GWCt0CHY509di3bPsLJdj3mtYu1gmIes7TzGVvKveHRQXqTc9h0jBq4u NGahWDkH4lcQIiPOKPSyDZQoLwox/ucau8pSrCFsg7nIC3Sy7UyIL3ySXmRW4I6HaK o/oLrZWWLah1WkfDwxw9xTSjdGVALS/HYcUz48pneXw9hDNosGMXHqR4ehy8lKf8yt WsasFrRh/zkWQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D0766180806 for ; Tue, 24 Feb 2026 19:32:35 +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.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from fout-b1-smtp.messagingengine.com (fout-b1-smtp.messagingengine.com [202.12.124.144]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 24 Feb 2026 19:32:35 +0000 (UTC) Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfout.stl.internal (Postfix) with ESMTP id 7CECA1D00124 for ; Tue, 24 Feb 2026 14:32:29 -0500 (EST) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-04.internal (MEProxy); Tue, 24 Feb 2026 14:32:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to; s=fm3; t=1771961549; x=1772047949; bh=Jm3IILPEfSEmHflFABB+D 5qPI4/m2r/LvPpWgm1hL4c=; b=waAC4PwggA78YafezjfVys6TpQbi31ZUbsynR cB3D5z4KyEjKY2xXtGu98W6BbLLmJpM6pnfJjNKvq8yt0KVF/LvlwFjzM5qBdT/A nIBEiVDwBCF7JTH6aIKUjoFbA4jzbv/h0sF3tQqxBqLmffYUYUuNaq1jEsLrm4Nv rMkvF/zPq9QP2AUjSgWAUjcZi+n/+6sZLNxn/F6XXiE9LvO/HybN6wx2qDFwq8dZ v8zXvGUi3Z+nkcbB5uIQCsSro3OmzVi1h7YjE4mAA9z+lOhhHx4bv3et7K/wWh7H KmdIpmpvTrVQPO1JzGOvb9CvEWthO6i79ANlZiENsX5H7vB3A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1771961549; x=1772047949; bh=J m3IILPEfSEmHflFABB+D5qPI4/m2r/LvPpWgm1hL4c=; b=Kwn8A07uNsUcKSlUD ORSe+lzxirvbYqZiL7NmesyFoXe3XSnKxhQce/v5XHRm1P17VLyUz7syIhwq7hp8 ltXNP134M/BD6qb3HOaWMCaFBIlMEGGFH7cf49H38Xb0FLgda/5hcVMW8kfktriI 0Gvoz0hXG0RAt4HSypZuNH4VCZ4dY9tIwIzPdioDmnyVaTOUGQHH5BCqzb7ybNkb GaaUm9ErzDZ05qUU9b+u/ADytzi44Dq1NjQKLC0ylqRX2JSYWEiYzxCjWICZmDXu LPYZRaYHFk/vPK5mgOCTiFNWvv8zhUZ5DcONhLLs6mO+Zj5k9DmHCI77Qz1BpBsQ I2wkg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvgedutdefucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepofggfffhvffkjghfufgtgfesthhqredtredtjeenucfhrhhomhepfdfnrghrrhih ucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhmqe enucggtffrrghtthgvrhhnpeffieeivdfhvdeguddttdegteeiueegvefhteehfeeffeet udeitdehtdegjeeuieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomhdpnhgspghrtghp thhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepihhnthgvrhhnrghlsh eslhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id F1F3D700065; Tue, 24 Feb 2026 14:32:28 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 X-ThreadId: ANGXx0lF93ac Date: Tue, 24 Feb 2026 13:32:07 -0600 To: "php internals" Message-ID: <96627211-d92f-4af4-ba45-6304a43e8575@app.fastmail.com> In-Reply-To: <7FA75C32-BC65-487B-BE44-272FEED42F04@wcflabs.de> References: <7FA75C32-BC65-487B-BE44-272FEED42F04@wcflabs.de> Subject: Re: [PHP-DEV] [RFC] Readonly Variables Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: larry@garfieldtech.com ("Larry Garfield") On Tue, Feb 24, 2026, at 12:52 PM, Joshua R=C3=BCsweg wrote: >> I would prefer starting with readonly parameters as I feel that would >> bring the most value. > > I find the idea of readonly parameters interesting and have already=20 > given it some thought. However, it is out of scope for this RFC, as I=20 > wanted to keep the initial proposal focused and manageable. I have=20 > already mentioned it in the Future Scope section of the RFC as a=20 > potential natural extension that could be addressed in a separate RFC=20 > in the future. A slight tangent here, but what would readonly parameters do? If you pass something by value, then already you cannot modify the value= in the caller. If the value is large, it's already kept efficient by c= opy-on-write. If you pass by reference, then presumably you *want* to modify the value= in the caller. If the value is an object, then as already discussed, its internals are = mutable either way so you gain little, but the function cannot change th= e identity in the caller anyway. So I don't see what readonly parameters would even accomplish. The thin= g they accomplish in JS or Java or C simply doesn't apply in PHP. I'm still undecided at the moment on readonly variables. --Larry Garfield