Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129982 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 C3FCC1A00BC for ; Mon, 2 Feb 2026 21:14:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1770066861; bh=ezGgR5qW8ZAIw1frMohizl2CREEXBaXkxoXJf5BNYTc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=N8qzRs7D9Mz6/+C76TrPj/Bb+jQErciq1PnflxIvRsprKR+zoYXZq1Olw1+BHqptu ff2NBS9lgvwzDh3uvknSCSu8oixHfI8o+DRnPXmP1OLtXbjgcedybd8pwehb1+pOUT 3M+Uy+UNDZdSxfY/6hv7H399vhkTzlOhHmTRatY16WKhoUcib5c/0tDXpQn1b71YHz 9bKNqhFirjcH4wSbBmkLdUO+Vr3U5xz4v08Y8bEaKJcC0dN0QNnxQvwqqXC0l+r3OX gsjzNMVXzRpE2aMsxocY34sb+aqH2yZ6aN/M2TPcO9zGAAzq7s6MKtmxhjKTYRlpbo S+ps3UDBkmYJQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BEA1E1801E3 for ; Mon, 2 Feb 2026 21:14:20 +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=2.6 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_50, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS, FORGED_GMAIL_RCVD,FREEMAIL_FROM,FREEMAIL_REPLY,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-qt1-f172.google.com (mail-qt1-f172.google.com [209.85.160.172]) (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, 2 Feb 2026 21:14:20 +0000 (UTC) Received: by mail-qt1-f172.google.com with SMTP id d75a77b69052e-5029901389dso38623761cf.2 for ; Mon, 02 Feb 2026 13:14:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1770066855; cv=none; d=google.com; s=arc-20240605; b=YpjACbxhDUAtjDzPynVErk7H8XMjjFqocu/qqoE2Jjs6tPX2tEgjN7ynqTvtHnEwXT tpH8deqWne4X8y3po4eRrh/POc/f+TXzOxpUAH8eBWbUObqzRLfhzXihJR1Z+HjrAslT bkKKKxhNfUdka3L1RR39Kx4tGbtsT8qPNoiNavhJKokXZgyTUDgnNqHWMhD6qYz9A1vy bu8fAQJXQEG7dqTrl7U0R+L2hWc7aCrlfZO6Vfe0UmgNTzyogKrfF6cZF9EWG3n4WrMd MFNOgVBUyZxIyFch1AkTs1alH8b2Xahcv6Z8qhON1Br3wbC0Ymmfs6+CyBHQAEvbsxhe /6cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=ezGgR5qW8ZAIw1frMohizl2CREEXBaXkxoXJf5BNYTc=; fh=ndI/RDHEh5lp4tLSlvnoTI+HKGMddSquYwx9T7pgZG4=; b=S6TUaFEUWfZM4U6b7W0PRQ0RtydRz5JvOJcRDD5JfYJleWHJ41EQe6JN+nnAIe9YQP 8D4BOOOp5rUk1xcv40JRqfJaRed3ZtVh+2wVzUURwES0V3BcJb13yD5BZgdXwz+WPBPw MMYbHmIqzce7v91jjCaxXfhaEo+2VsephrumKoG+gMNNNyJmoae57h815Tzh4hEvK0Q7 zX5PH6ehQlbzAnQBUJQwH/kNFg/WDIqb78EpIglfB+C30IiBOzyoyKPhQUtrecsJqycU urIOqhXyi1mJRgtc3U/jLvpbPdteUl3g0fpMoCOtYZP463ddWnJ/GdNfhowbOQG7NZyW PQuQ==; darn=lists.php.net ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770066855; x=1770671655; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ezGgR5qW8ZAIw1frMohizl2CREEXBaXkxoXJf5BNYTc=; b=JPbjOPJOtfyd+81MXR9TQ5W+L/pxH9XA85mgSZ2mYRxysmgA6H4OqkEAVnNvrQrXkV YZXIrFk8DGmjic49MtBhk9hHd9h14APy6xjfbCfVusA8kEzrcKWmO2Cl0FP9YlYV7xN7 lhalIsuL9zg2NOeWyI8qGnDmHJSigwCoEqVEcifhBfczCFcIEyvh/KFV/E7t4rY3aYKY mQAi1/MBLmmtIA0zl+PC+KxnD2LYlfxC09aZ8F9UNK1eAPro+ufd4X+i/RQWKnUHD50T FuJeGjk6V9rQSpDEQApdwOCja3qG9wHVu2ULJi6E/FV1ps3PTCqmE5mPTmnocrrY+OVN tpzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770066855; x=1770671655; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ezGgR5qW8ZAIw1frMohizl2CREEXBaXkxoXJf5BNYTc=; b=vB54I2tbC2jPLdKyR0m13XB2Uhd7kQ5O+AguGVgcXbYR8HaNteiA8YPWqZqOuTQV26 zMrDqv2OR9yQ+TU0okkq20RhMLmD1t8m/2l55ObD2xTFiN79j+q/BGfJU33wXK1hND8i HHbX8ts4c5X/rQSRAg8YhZMD23qzpb58PMc2yQz7h2O6FII4g0/oConSfkE5nEQhRP/1 IfTWUxRycbsM2e+CJVZyBH/EFlQc92gnR8oQRz6x/pU8y8ivuZRQtbpmuROXhb6EcR+X TVq2EP7tUIY9SpmwyIeNALRAsgr7oM9QZzhpQ34GqpHmuHPFd8s63VbNZJ11CQWH6BAY 40FA== X-Gm-Message-State: AOJu0YxruCOVnmKwOShW+ViuLpVoGx4lHxRkY4anYYBTzzZ8+yqRfX5/ vHXbZNbjRB20SfvS/OehYHzokW5b5dXZCcw3HNpde/pjeyo0pf/xoWIaF7QSEOlTzGLl1QPxWuB lQb05HqVQoQSAYwUGqB8/n5xJkTaMOGQ= X-Gm-Gg: AZuq6aIRhZysOmjP16ev0dw4RlVjSXkeveHkcYHCt42HjnR1MUY5nDRyjN+t/ReqlnE ZJxjJSg/G3GAfnGJWiUX0f+uIqfmtk9Qk/U6hSMMKcevz3W0TSm73u40hFX5LsJlDXN9azr0VCm QrsPnLocJaDqJS6NBLhPX16ieC8tggyB/QxGoOKIyauxLlieetg/ZDBHzT0g6Cg1B5638IJWBM9 R20ZD0Ue3noEoBEKd4UyjuN4+lgWRMRPZLmd1tUTatUngVySq/UgGR4j0CP04MxDGRW3ab3DA9a YDn+vI9nIYbqca2Z2H9YrOI6dH5ppHbyhnvRRZZIK8BioWVyf6nk3P+e X-Received: by 2002:ac8:594b:0:b0:4ee:dad:27a2 with SMTP id d75a77b69052e-505d2267066mr151461911cf.51.1770066854631; Mon, 02 Feb 2026 13:14:14 -0800 (PST) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 2 Feb 2026 22:14:03 +0100 X-Gm-Features: AZwV_Qg6PJcuZctw8T1Xm_ySlGsQukSu7SaKYaiSbtagpPRi4hjNzCMW2rgFcbA Message-ID: Subject: Re: [PHP-DEV] [RFC] Allow Reassignment of Promoted Readonly Properties in Constructor To: Marco Pivetta Cc: PHP Internals List Content-Type: multipart/alternative; boundary="0000000000001960b20649ddceca" From: nicolas.grekas+php@gmail.com (Nicolas Grekas) --0000000000001960b20649ddceca Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Marco, Le lun. 2 f=C3=A9vr. 2026 =C3=A0 11:54, Marco Pivetta = a =C3=A9crit : > Hey Nicolas, > > > On Thu, 22 Jan 2026 at 16:34, Nicolas Grekas > wrote: > >> Dear all, >> >> Here is a new RFC for you to consider: >> https://wiki.php.net/rfc/promoted_readonly_constructor_reassign >> > > > What happens if one calls `$obj->__construct(1, 2, 3)` (on an already > instantiated `$obj`) in the context of this patch? > Thanks for asking, I didn't think about this. This made me also think about ReflectionClass::newInstanceWithoutConstructor(). I clarified this in the RFC, see "Direct __construct() Calls Cannot Bypass Readonly" and "Reflection: Objects Created Without Constructor". Patch and PR updated also if anyone wants to run some code where this RFC can be played with. Cheers, Nicolas --0000000000001960b20649ddceca Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Marco,

Le=C2=A0lu= n. 2 f=C3=A9vr. 2026 =C3=A0=C2=A011:54, Marco Pivetta <ocramius@gmail.com> a =C3=A9crit=C2=A0:
Hey Nicolas,


=
On Thu, 22 Jan 2026 at 16:34, Nicolas= Grekas <nicolas.grekas+php@gmail.com> wrote:
Dear all,
=
Here is a=C2=A0new RFC for you to consider:


What = happens if one calls `$obj->__construct(1, 2, 3)` (on an already instant= iated `$obj`) in the context of this patch?

Thanks for asking, I didn't think about this. = This made me also think about ReflectionClass::newInstanceWithoutConstructo= r().
I clarified this in the RFC, see "Direct __construct() = Calls Cannot Bypass Readonly" and "Reflection: Objects Created Wi= thout Constructor".
Patch and PR updated also if anyone want= s to run some code where this RFC can be played with.

<= div>Cheers,
Nicolas

--0000000000001960b20649ddceca--