On Tue, Mar 9, 2021 at 11:16 PM Kévin Dunglas wrote:
> Hi folks,
>
> Currently, it's not possible to use the ::class special constant with the
> constant() function. This doesn't work:
>
> var_dump(
> constant('\DateTime::class')
> );
>
> For instance, Twig's constant() helper internally uses t
On 9 March 2021 22:15:49 GMT, "Kévin Dunglas" wrote:
>Hi folks,
>
>Currently, it's not possible to use the ::class special constant with
>the
>constant() function. This doesn't work:
>
>var_dump(
> constant('\DateTime::class')
>);
While this looks logical at first glance, I'm not sure this can
Hi Kévin,
My opinion is that you should write an RFC. I have to admit I was a little
confused when I initially read your email, because I never considered
::class to be a constant. It is a special constant, which is described as a
keyword in the manual. If I understand it correctly the value is ob
Hi folks,
Currently, it's not possible to use the ::class special constant with the
constant() function. This doesn't work:
var_dump(
constant('\DateTime::class')
);
For instance, Twig's constant() helper internally uses this PHP function,
consequently the following Twig template doesn't work: