> Le 16 nov. 2021 à 18:34, Kamil Tekiela <tekiela...@gmail.com> a écrit :
> 
> 
> At the moment, ::class is just a preprocessor macro. It is not part of the
> runtime. 

This is not true in general. For example `static::class` is not resolvable at 
compile-time.

(In fact, many years ago, when I played with that new feature, I almost filed a 
bug report saying that `static::class` is not supposed to work, since it is not 
resolvable at compile-time.)

(Additionally, since PHP 8, it is also possible to write `$object::class`, see: 
https://wiki.php.net/rfc/class_name_literal_on_object 
<https://wiki.php.net/rfc/class_name_literal_on_object>. But `static::class` 
worked since 5.5.)

—Claude

Reply via email to