Newsgroups: php.internals
Path: news.php.net
Xref: news.php.net php.internals:108126
Return-Path: <george.banyard@gmail.com>
Delivered-To: mailing list internals@lists.php.net
Received: (qmail 34266 invoked from network); 14 Jan 2020 20:07:49 -0000
Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5)
  by pb1.pair.com with SMTP; 14 Jan 2020 20:07:49 -0000
Received: from php-smtp4.php.net (localhost [127.0.0.1])
	by php-smtp4.php.net (Postfix) with ESMTP id 775AF18053D
	for <internals@lists.php.net>; Tue, 14 Jan 2020 10:14:44 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,
	DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE,
	RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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: <george.banyard@gmail.com>
Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53])
	(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 <internals@lists.php.net>; Tue, 14 Jan 2020 10:14:43 -0800 (PST)
Received: by mail-ed1-f53.google.com with SMTP id m8so12760105edi.13
        for <internals@lists.php.net>; Tue, 14 Jan 2020 10:14:43 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=mime-version:references:in-reply-to:from:date:message-id:subject:to
         :cc;
        bh=iYrJ1vVbefl5hYp3PjdbazvRpHEHGSo3Mw6R1id8SVo=;
        b=qOFpc9ns5EERWwEnkOzIaSuZpS4E4foZev9wQNzrkkV30g3kKGpz3yyEBemsSkdVy8
         UOrB2YzPa/XpXU8TkagKiXgLHZhET9MDleV7L/fu7o5y3IOsujXb3Sj3iFL9QkqHKmlZ
         BwvI+XQusdz7fT6zuJbmQ5ucZ9Ozy1Y+SkiV1TvN50tjeYDe2rql9KYRU1rJyiNHs8oW
         poZ18KwnvGdXJv6Rbh+Qz+nt/4+RNECuz2t4HzR9a3TG82RH1hRBwp6sa1B54LTgr93H
         Tcyao6lurXUBGzaMQdtw/HIBEMncnNJ6hzL7Md4i9XbqoKAiGjS3zur1ig6tOdDWFePz
         xAeQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:references:in-reply-to:from:date
         :message-id:subject:to:cc;
        bh=iYrJ1vVbefl5hYp3PjdbazvRpHEHGSo3Mw6R1id8SVo=;
        b=jXCMXoZOk7bpxvQVM6cgbetJ3XQdvaKTsJGZX1Rpn9INNMbTQ7gRX+l0TZioSsyImD
         ZAVXXl2sunnlGJfzZq1axU7gQGmqy0s2FHbcHzuMNjcou+EmEUWY1fVA8ACd83O+cwUx
         G6XUJF9ENgkh8kprq0vcs8n72UI0WgU2wm/Yt6o6W8TgyoV0odXMKPPJjMqUHq2SQbGx
         96rvl0y8rtCbRI1qM+U3Z2z/6LijeBggVsWaQUeV1OviKyn+WmFKw8nWGD+WC5UYjyXo
         N5nr+/i6AW/WLaHU9NmUFYbeD0wi1LtHNR08AszdIKhi+T1WhULlW0Oi6oF+d0X5IHW8
         qhgA==
X-Gm-Message-State: APjAAAWvzcNl8Dzb+d/9Lv2osFD3t7NZT1FM76imrTmD5p5XR9rj071K
	lA7ULpInXgGRduqMmpTatW5Di8AqdPu3tApK2aA=
X-Google-Smtp-Source: APXvYqzgwx8U5JeBULN+QiLXsUGssB3GYnjN27c6339224Ycnlu5qbZNRNkqHzepLO9ozm1EuC1KExSvij85z+vCuPM=
X-Received: by 2002:a17:906:35da:: with SMTP id p26mr5229459ejb.9.1579025677800;
 Tue, 14 Jan 2020 10:14:37 -0800 (PST)
MIME-Version: 1.0
References: <CAF+90c_PXAa8PSBzULa0WHViQ-XvuX+BuYQfx6c1zOf-9pOA=A@mail.gmail.com>
 <e64fe4bd-4cbf-0528-6505-0b57fe9afea6@ralphschindler.com> <CAF+90c8r2fNLcg4X4Xwf8-sbckMF-DP_T0hGdW34W23Ra1JRrw@mail.gmail.com>
 <CAOWwgpm9YAfdAwmoVhmDempAVan-YnRPGq-EUfd-pe6saa08yA@mail.gmail.com>
 <CAF+90c9agNywyza854gSiJ_iaNL8nWi4hB0kA1o597VUqpPRyQ@mail.gmail.com> <3e9a226e-0ce4-9225-e314-dd565e1e80a7@ralphschindler.com>
In-Reply-To: <3e9a226e-0ce4-9225-e314-dd565e1e80a7@ralphschindler.com>
Date: Tue, 14 Jan 2020 19:14:25 +0100
Message-ID: <CAFPFaM+HVF_kmExgg6L3VHuQM0fb9MzPpC33VHiPmmtfiDw39Q@mail.gmail.com>
To: Ralph Schindler <ralph@ralphschindler.com>
Cc: PHP internals <internals@lists.php.net>, Nikita Popov <nikita.ppv@gmail.com>
Content-Type: multipart/alternative; boundary="0000000000009ddb0c059c1d9035"
Subject: Re: [PHP-DEV] [RFC] Allow ::class on objects
From: george.banyard@gmail.com ("G. P. B.")

--0000000000009ddb0c059c1d9035
Content-Type: text/plain; charset="UTF-8"

On Tue, 14 Jan 2020 at 19:05, Ralph Schindler <ralph@ralphschindler.com>
wrote:

>
>
> > just return $string, to be consistent with usual behavior of
> > "::CONST_NAME", which allows objects and class names on the left hand
> side.
>
> Having given it more thought, it seems like like $string::class should
> be more aligned with get_class($string), which at current throws a PHP
> Warning with the message:
>
> "PHP Warning:  get_class() expects parameter 1 to be object, string
> given in ..."
>

This is going to be a TypeError in PHP 8 following the consistent type
error RFC [1]
therefore the current behaviour to throw a TypeError is inline which
get_class()

George P. Banyard

[1] https://wiki.php.net/rfc/consistent_type_errors

--0000000000009ddb0c059c1d9035--