Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115687 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 13311 invoked from network); 11 Aug 2021 03:15:51 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 11 Aug 2021 03:15:51 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9B33C1804CF for ; Tue, 10 Aug 2021 20:46:25 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 10 Aug 2021 20:46:24 -0700 (PDT) Received: by mail-qk1-f172.google.com with SMTP id t66so1003984qkb.0 for ; Tue, 10 Aug 2021 20:46:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=qnElqNoahesUFt8Ra7U5dT3DqZ0rSVMqyTr9ZzrwCPo=; b=KTBsETX3u4U/vZW3wHLlodWVavH8sPQxPM1vTAo4dvFx/AGH9cmPK5fp23iEFiFCCC kpgJCmPbJqyLijjdD4HHSa1CG4wQlhkpK+5kmSIjoLzxsNDd+eFzWUPEr5KimlC6rEuq khD1UAJmhKtKTJP3bhikcySEhqxi6nDqBE/CLajd4cijtfa0rULxGe3fJwmDzlYP0PZS qylU4twI7Km/R5V7qCHdLazRRZyniAbw+HXy/EUFj3McUWzD2HiOvVccj3gEK0ZUbtsg dt4xzJCDOtPIncNyZsyfUyKHOdCMqaiGR752PW6Fq+ga8nWAexwMknZcEmAXpBbz6+VX H+oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=qnElqNoahesUFt8Ra7U5dT3DqZ0rSVMqyTr9ZzrwCPo=; b=am/J0UILMl7KdgFSN4yorWyMprvcyo3x4eJGMpFm1TxQkj18npNHSbPqHSQxiI+cO+ ulll1nRVZFMpY+xpbZyK9J+fV7NsZwUwSUR2G081/LOzv/gYQ/9vMCnv91aKzGL38KQT BP48Nc3i+Vn+6ih63v72TZTAguDaibA16M2UJnIkwqsJ4WXXyKwTrcNpgTGLizYn11Sl xIO0fPWnmhYi/iWfgHI3fhmpSxbBVutSLpUqIRz0D5P54Xi7qwECGVXNUXKwbN0b2ghc QIhlHW5ZUNd4FXGbUcGoPNJZoV6Q56moc1uL3z1117R566cgZCeC6BS8bPNIVws6kmu6 CIHA== X-Gm-Message-State: AOAM533Jj2Hgha2NJrqxRnjmSlrEJmF9gR9AtKU9llIVnThx6oya6TQq tnDKgUBEbjqNQ6NiFK252bwXXFCpV5567A== X-Google-Smtp-Source: ABdhPJwmoW9QoRzL9oMCHhguk1AB6gXtXollvB/rmEwbzaZj9uho5lZQBlId8Fb+6g/oZ3lJcUP23w== X-Received: by 2002:a37:b6c1:: with SMTP id g184mr31734008qkf.270.1628653584247; Tue, 10 Aug 2021 20:46:24 -0700 (PDT) Received: from [192.168.1.10] (c-24-98-254-8.hsd1.ga.comcast.net. [24.98.254.8]) by smtp.gmail.com with ESMTPSA id 70sm7826766qtb.20.2021.08.10.20.46.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Aug 2021 20:46:23 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) In-Reply-To: Date: Tue, 10 Aug 2021 23:46:22 -0400 Cc: php internals Content-Transfer-Encoding: quoted-printable Message-ID: <3D7F74C1-F1A0-4258-8EE3-3C143B6B54EB@newclarity.net> References: <94696d46-c4e6-406a-b859-89144bff31bf@www.fastmail.com> To: Larry Garfield X-Mailer: Apple Mail (2.3608.120.23.2.7) Subject: Re: [PHP-DEV] Revisiting Userland Operator Overloads From: mike@newclarity.net (Mike Schinkel) > On Aug 10, 2021, at 10:22 AM, Larry Garfield = wrote: >=20 > Point of order: I do not support a dedicated value-object/data-object = construct, and have said so explicitly. I support targeted tools that = make using objects in that fashion cleaner and more robust. (readonly, = asymmetric visibility, clone-with, etc.) Please do not misrepresent my = position, especially when I've been fairly consistent on it. >=20 > Also, one of the biggest failings of SPL is the degree to which it = leverages and forces extension rather than interfaces. Inheritance is a = code reuse tool, NOT an architecture tool. That's what interfaces are = for. We know this. We've been bitten by this. Building any kind of = inheritance-based operator overloading into the language would be a = terrible idea. Let us never speak of it again. Seems that you have chosen to callout a distinction and take offense = to[*] that I was never intending.=20 When I referenced value objects the *how* was not the important part of = my discussion but instead that fact that we do get there, evidenced by = my use of "Or ???" when hypothesizing. If the way PHP gets there is that a value object is an object where all = non-private properties are explicitly declared readonly then that is as = workable as if we explicitly define the class with a "value" keyword. I = don't really care as I see it as a distinction without a difference.=20 Either way if PHP can identify a value object then it could limit = operator overloads to just classes that are value objects by whatever = approach PHP chooses to distinguish. -Mike [*] Ironically I mentioned you because I thought you would be appreciate = seeing another reason PHP could benefit from value objects. But as they = say, no good deeds go unpunished.=