On 17/06/2026 16:59, Juris Evertovskis wrote:
1. I don't think it's necessary to mess with ::class here.
People are used to it not doing any checks. If it started doing some
checks it would
get confusing: why does it tell me if the case is wrong but says nothing
if the class
doesn't exist? And the warning is fired conditionally on whether the
class is already
loaded or not, which, according to RFC, is not a cool behaviour.
Besides that wrong case warning would disappear and go back to silent
in PHP 9.0, right?
I agree, that #2.9.2 is basically a string constant not really related
to the class itself, adding a check is not beneficial. If that string is
used to initiate a class, there will be some another warning from this
RFC about it anyway.
--
Anton