Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129839 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 C51511A00BC for ; Thu, 22 Jan 2026 08:31:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1769070685; bh=P7iJ1MBOkYZGy7jQIWL9h71C387JKAXiQk5mziQpU5Y=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=mwmuRKRRn+M6HUNaaMj8SQ5SP9YK/YKI7pavF0oqznbakJ5TT8xLh0H8z5HAkq4t+ rVxz24evcxzWXUBfmr4Ht74JEN4ptnG1uRjbSsWB/7NEQb+gT0VJW9FiywrOXendAo +wns6sXqDU0ndHOPUAfdpTvLlCGBX0e8VmNjn+JFBO6ySzq4+J0x8drEwqnw1/r30Z rik8hchOZG7BKroph4CqinL3/IACatoLZ1chEC6bWOzgyhLYK0xNw9w0tTWA/RDe5n TCmfOyHLfnbIybmvUC4mhrcgmxHhvceJviAJPuX6XAu9piAgfyYGlx9n9jS/i5wzbp 7h/S61UNpkdLA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id DD0A9180602 for ; Thu, 22 Jan 2026 08:31:23 +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 ; Thu, 22 Jan 2026 08:31:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1769070676; bh=ggiHN1nq2OYQ6uCrtSP4ALg7VMKpxvtoRqkzE7NZ1Wk=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type:from:to:cc:subject:message-id; b=b8QsB7zX+W55WwEzTdw10bU1sF0u0T44pLulGwgbnOKBt4517OTQOWVIIilcN7uMV zJH9NuzDfIDyAYPBtPzpiGW8JHWJBlrZ6x8SRDj8N/xzfMsf693lyy40khF9Bq9eow 1cbn+Hewo6cfkTQSXKa3MH7Q7ODQcl4TQwsTPL6W6ryAOLkdkOlf6LLTf6eK7JA9zv goZNU4tjHTq4DhgHSsuiB5XRZyrHv1unWO1PcJ54YhorrBXzLx2DVi3Q8TjuErjX0R ru/cM4BuBuZGlNDWADEAdY7gT49B9HTaqEL3YW7r0ya78yJZvlUHfWU+ScvLELLsSl QvPjIvPYoPAUw== Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Date: Thu, 22 Jan 2026 09:31:16 +0100 To: Ilija Tovilo Cc: PHP internals Subject: Re: [PHP-DEV] [php-src] PR #20903: GH-10497 (const obj->prop write) - language change notes In-Reply-To: References: Message-ID: <433cf40fdc4a5459b9b87e966f02a96f@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 2026-01-22 00:33, schrieb Ilija Tovilo: > No strong opinions on my part, but I'd like to point out that similar > situations already exist. > > https://3v4l.org/ARMMS#v8.4.14 > > const C = [1, 2, 3]; > function foo(): array { > return C; > } > foo()[] = 4; > var_dump(C); > > PHP will happily duplicate the array returned from foo() to append 4, > without warning. The original array in C remains unmodified. It might I'm aware. However to me this situation is a little different, intuition-wise: A return value already looks and feels like a temporary value to me (unless a by-ref return is used, of course, but those are rare). An access on a const does not. > make sense for ASSIGN_DIM to warn/throw if OP1 is not a "pointer" > (indirect, reference or object), as then the operation will never have > an effect. But it seems to me this is a distinct issue. That makes sense to me and IMO is a necessary precursor for this. Best regards Tim Düsterhus