Re: [RFC] Allow ::class on objects

From: Date: Thu, 09 Jan 2020 14:27:36 +0000
Subject: Re: [RFC] Allow ::class on objects
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-108061@lists.php.net to get a copy of this message
Another small RFC, to allow $object::class syntax: https://wiki.php.net/rfc/class_name_literal_on_object
Hi Nikita, Glad to see enhancements to ::class. Open questions, given:
    class Foo {}
    $foo = new Foo;
    echo $foo::class; // Foo
    $fooClass = Foo::class;
    echo $foo::class; // TypeError b/c string?
    $fooAnon = new class extends Foo {};
    echo $fooAnon::class; // TypeError or class@anonymous?
There's prob a few more edge cases, but this is a start. -ralph

« previous php.internals (#108061) next »