Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126044 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 DEC191A0101 for ; Sun, 24 Nov 2024 18:01:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1732471079; bh=5rNkUB7QLp1+rW1WIVFLxiic0hdLzig7cUH8DjPlVJo=; h=Date:Subject:To:References:From:In-Reply-To:From; b=jVqQpPF9K/SNZL/lOEcMYxmp1im8KI4rUi+YyfumUaB4X9GCBvLEwChSFijiSBSUV 2lNpmT+baxUZzzW68fX8+xNJlyDXukbaalWUnD6U2plkrUGbR6pHA7hjXhO7T7u1aW JcBBZmsPuyMSImaWMK9yjGlom+JP/ybjYO35IvtxvPI7E+vlxSDCEh0ENLDcuQSp2p nTCnk6rFhYRuP4I3SHEk/io6hlalB4m5K0nfAMRZM/wC70mpzYpJiNJqDVaoqz/+oW 3BxwskB77WwvaWLNsVnw2hCiSypMzJTWupcImZA6MZbUlmj7zNGzVyr7k5yQBxlwmR xKwBBbyWfxqCQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id CF31E1801D7 for ; Sun, 24 Nov 2024 17:57:55 +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.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_PASS autolearn=no autolearn_force=no version=4.0.0 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) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 24 Nov 2024 17:57:55 +0000 (UTC) Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfout.stl.internal (Postfix) with ESMTP id D336E114016B for ; Sun, 24 Nov 2024 09:38:22 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Sun, 24 Nov 2024 09:38:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; 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=fm1; t=1732459102; x=1732545502; bh=lUeUF8n5B4oDw34N4tq+KnMVxHPOV+7+AzA5Z8C4xN4=; b= ZSc45SIxg+YQyqeONV23drev1Nb1ZYj+A8Qw/4trbLdOzuMh1kNqmDGcB4CfkBMT X5MEXpOGgzwObxCYmRZAg8RJ5AXLgkr0DoMOpHLPC0vtvCCVzmvYdtPFiEo9pGzY KjHw4+4XKwA5krnNQTnbcoln1chgf1SJJY4Jsgj92VkzzZUi/65ccWhqu+3EXKQ7 PwrbAYGSZ5XibhjjDARZVLf4hdTRtr2lLmzMo5JI5ncs8GxhLiMhz8L1UsduNe5b C2c3cuCpy2A36+lp30V5Ouum9qDvwrkfX5kgM4GX7opAR5J0ugOdI473s9hRj1R0 joBNzCSarNw5syPAfVklLQ== 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=fm1; t=1732459102; x=1732545502; bh=l UeUF8n5B4oDw34N4tq+KnMVxHPOV+7+AzA5Z8C4xN4=; b=Sj3Kbm2l6GGvQUuCN rSOihAjzzkrCwq4hqpMTYy5h9aVp4/OJsDZz7KthIMlz0i6M/1JKNRmSmDEJ7qFk Cs+9QMjLu9Pdz39Z+KN+SYgQEaBYBVb2bItQDWBwmt1/9gP+XFCvl6OzXhvTGOLR cTAxqCK1aGKN+T1xIFzKDRNZqruordW8Gr7QbiSTBk9cYb7IHzRrfN08kV3xvN21 XXRfrRLZmkAPB9CPslxkY8qvHEos7TIhNSWiBqFi+bhAx9HyJQbeyltWu/rhx+2j jUtrjsv4Yy4U77JqYnHhmuW5nws8OYTjBc1gxl568aMb4KDGO4iALddWlLzIhuyE azjJg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrgeefgdeiiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecuogfuuhhsphgvtghtffhomh grihhnucdlgeelmdenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtjeertddtvdejnecu hfhrohhmpedftfhofigrnhcuvfhomhhmihhnshculgfkoffuohfrngdfuceoihhmshhoph drphhhphesrhifvggtrdgtohdruhhkqeenucggtffrrghtthgvrhhnpeeufeefjedtvdet tddukeffueefvdeulefgteejgfdufedtgeejhffhheffveeuhfenucffohhmrghinhepfe hvgehlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhf rhhomhepihhmshhophdrphhhphesrhifvggtrdgtohdruhhkpdhnsggprhgtphhtthhope dupdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehinhhtvghrnhgrlhhssehlihhs thhsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Sun, 24 Nov 2024 09:38:22 -0500 (EST) Message-ID: <7c82a45e-6516-4bcf-a00f-3d994d4be2f4@rwec.co.uk> Date: Sun, 24 Nov 2024 14:38:17 +0000 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] [RFC] Data Classes To: internals@lists.php.net References: <18b85ba5-5f1c-489c-9096-3ae203977fbe@app.fastmail.com> <66b25296-ca81-4029-b6f6-064cfd810635@app.fastmail.com> Content-Language: en-GB In-Reply-To: <66b25296-ca81-4029-b6f6-064cfd810635@app.fastmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") Hi Larry, I think that's a useful breakdown of the concepts involved. I don't think it's a bad thing to have a feature that covers multiple of them - common cases shouldn't need a long string of modifiers like "immutable copyonwrite valueequality class Point { ... }" - but being explicit about what we are and are not including is wise. There is one point I'd like to nitpick on, though: On 23/11/2024 20:35, Larry Garfield wrote: > 3. Physical equality. This is what === does, and checks that two variables refer to the same memory location. Physical equality implies logical equality, but not vice versa. PHP's === operator is not, in general, an identity operator; it is a "strict equality" operator, whose exact meaning depends on the type of its operands. For "scalar" types, it checks the concrete type and the value: 1+1 === 2, and strtoupper('hello') === 'HELLO' For arrays, the definition is applied recursively: two arrays are loosely equal if all their elements are loosely equal, and strictly equal if all their elements are strictly equal. Objects are really the outlier, overloading the operator to mean "identity" rather than applying a strict value comparison. Example: https://3v4l.org/udOoU If we introduce some new "value type", it seems very reasonable to use the same recursive definition of strict equality used for arrays. -- Rowan Tommins [IMSoP]