Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108083 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 69485 invoked from network); 10 Jan 2020 00:51:09 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 Jan 2020 00:51:09 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id DE4C418050B for ; Thu, 9 Jan 2020 14:56:55 -0800 (PST) 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,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-yb1-f182.google.com (mail-yb1-f182.google.com [209.85.219.182]) (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 ; Thu, 9 Jan 2020 14:56:55 -0800 (PST) Received: by mail-yb1-f182.google.com with SMTP id z10so3654939ybr.9 for ; Thu, 09 Jan 2020 14:56:55 -0800 (PST) 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=muNkbGwJFINY5xNak4XDxbV/56i6Pbu3I0IXT96oFmc=; b=m6m81MW29H4e4A36JUpNT1HqHC4y/d9JxruhGWjicXxsI/HKTwEUFngDrxTwKe/YNP raF7tepjsizkDBqpMh7sPeor82H+20sYx4ck4x0xaCGbtzPKArZk8Htlbq+KR5+hm/iq cL/+FNTjD3qy33U7KE09EfsWsba/X6Jfik699nA8hYVHZXVb1b4AgidzNHLPGRDe5qwc wqFMBPWVPc/jCI8iGg7DTgvz1kbi/aMN1BCeTfa5psXTOA7mD2rXLcIePyVjaPGpYoA3 WblQgCTnbHM2UXx24/wxG+YMh/EXzfC0cZYrm24jXg+RLx7cuOMgR7BZmlLyrp2Rwwod SYxw== 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=muNkbGwJFINY5xNak4XDxbV/56i6Pbu3I0IXT96oFmc=; b=DKsoFlpjIOPv59pzTYev4Zjwy04g2Pjqr9fpEq8JfdBqXw/BBy4BD9EFYfVvH2QyWl adsuwqyaEjpZp8rT7cYTRNmBOnojSWBsuVs56AxTQlMbOU4SBj6grko+RslbyC4Xk89U 5PK6RFE20P1SPo8xpJDe9qvPirkvxuX/pQI/8L3fCX8y18q9G8SSEKBGW5yPE653Z9KM 5RT+PZ/YkEWPkTdKzpSJ4AlZABmcOoPcOr96h5UCnWTqyN8LQR1K9dkdbxaqd18DPDVp mGn7PTG0YfFfzSqG29yM7C7qBlr1ZmGMR9AAOH7HpO3QHqlXjuR6Ul2Fw0BXP/p5svN/ J1Zw== X-Gm-Message-State: APjAAAXTS2WTzIgspbS4MjvQvYN7nHG+LJgrDRzjYFmjTsJsYDXCuuTP m/VMLB2yCasTb4ZkhIMKx0gD9A== X-Google-Smtp-Source: APXvYqx7unA7QsTcoLSFKwObqO9TK/ClL3V1G5/oVzMnQPe8pBGRnJb/aWoGFGNdDt/2ekbizJwo0Q== X-Received: by 2002:a25:bf85:: with SMTP id l5mr34504ybk.189.1578610611600; Thu, 09 Jan 2020 14:56:51 -0800 (PST) Received: from ?IPv6:2601:c0:c680:5cc0:480:e2c0:f7b2:a682? ([2601:c0:c680:5cc0:480:e2c0:f7b2:a682]) by smtp.gmail.com with ESMTPSA id d143sm147582ywb.51.2020.01.09.14.56.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jan 2020 14:56:51 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) In-Reply-To: Date: Thu, 9 Jan 2020 17:56:50 -0500 Cc: Ralph Schindler , Internals Content-Transfer-Encoding: quoted-printable Message-ID: <64EF5D53-AEEE-40F7-BD07-02BAE245C9A7@newclarity.net> References: <13CC52AA-7690-42C6-89B7-B8FA4166BF38@newclarity.net> <57c08851-e6e2-c0bd-76e1-f7a0388d64b4@ralphschindler.com> <60610660-2E38-47BD-A998-1E226CEB3701@newclarity.net> <032B5597-6CB6-4F5E-BDDC-8A508C3FCE93@newclarity.net> To: Kalle Sommer Nielsen X-Mailer: Apple Mail (2.3445.104.11) Subject: Re: [PHP-DEV] [RFC] Allow ::class on objects From: mike@newclarity.net (Mike Schinkel) > On Jan 9, 2020, at 5:30 PM, Kalle Sommer Nielsen = wrote: >=20 > I cannot see any benefits to adding the ::trait syntax (nor the = ::interface) one > besides some OCD issue that you are using ::class on an instance or = name > of something that technically is not a class, like in your below > example, even less when ::class already is working. The benefit is _clarity_ for when reading code. Is wanting clarity = considered OCD? >> Traits are symbols, so it is not unreasonable that there would be a = way to access it symbolically so that the reference can be type checked. >=20 > That is where you are wrong, traits are not contracts, so therefore > they are not types. That is a distinction without a difference. =20 And I did not say I wanted to check it for a contract. I simply wanted = to reference it. > They are a useless symbol to refer to in the context of ::class.=20 I said I wanted to refer to it when composing error message, as one = example. That is not useless. Why is it so important to push back on this? What harm does having it = cause when clarity is the benefit? > but in your example you are still referring to the trait as it was a = type How am I referring to the trait as a type? I simply referenced it in an = error message. > That is fine if the instanceof operator does not do it for you, but > you could have left that last part of the comment out of the mail, > after all, it was just a tip. I am frustrated by people constantly telling me how they think I should = code when I ask for features, that people assume because they cannot = envision it that a feature is problematic, and I was annoyed you assumed = that as someone on this list I would need that tip. =20 But you are right. I apologize. -Mike