Req #77559 [Com]: Support callable::class and array::class
| From: | mister dot pedantic at example dot org | Date: | Sun, 03 Feb 2019 04:22:12 +0000 |
| Subject: | Req #77559 [Com]: Support callable::class and array::class | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-219343@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77559&edit=1
ID: 77559
Comment by: mister dot pedantic at example dot org
Reported by: mister dot pedantic at example dot org
Summary: Support callable::class and array::class
Status: Not a bug
Type: Feature/Change Request
Package: *General Issues
Operating System: Irrelevant
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Also static is a keyword, but static::class works. they are all de-facto classes/types.
Previous Comments:
------------------------------------------------------------------------
[2019-02-03 04:04:56] requinix@php.net
Actually this should get a longer answer.
array and callable are keywords. They cannot be used for classes.
http://php.net/manual/en/reserved.keywords.php
int and string and such are not keywords, so int::class and string::class are supported. However at
this time you cannot create classes named "int" or "string" because PHP is
reserving those for its own possible future implementation.
------------------------------------------------------------------------
[2019-02-03 03:58:29] requinix@php.net
Neither of those are classes.
------------------------------------------------------------------------
[2019-02-03 03:53:51] mister dot pedantic at example dot org
Description:
------------
AFAIK, all ::class work except these two.
Thanks.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=77559&edit=1