On 15 May 2023 18:44:47 BST, Robert Landers <landers.rob...@gmail.com> wrote: >use const \NoExist\TEST; >use \NoExist\Channel; >echo TEST; >echo Channel::class; > >the output is: > >Undefined constant "TEST" in ... >Channel
I'm not sure how you got that; according to https://3v4l.org/gltKN only PHP 5.6 has a message with the unqualified name: > Notice: Use of undefined constant TEST - assumed 'TEST' in /in/gltKN on line 5 Before that, there was no "use const", and in every version after that, it's a fatal error with the fully qualified name: > Fatal error: Uncaught Error: Undefined constant "NoExist\TEST" in /in/gltKN:5 Take the constant part away so that the next line runs, and https://3v4l.org/q0XQO shows the fully qualified name right back up PHP 5.5, because expanding the name is actually the *only* thing that ::class does in that context. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php