| Newsgroups |
php.notes |
| Message-ID |
<[email protected]> |
As of PHP 8.1, not only classes (including abstracts and traits), interfaces, functions, and constants are affected by namespaces, but also enums.
<?php
namespace App\Types;
enum Colors {
case Red;
case Green;
}
$reflection = new \ReflectionEnum('App\Types\Colors');
var_dump($reflection->getName()); // string(16) "App\Types\Colors"
var_dump($reflection->getNamespaceName()); // string(9) "App\Types"
?>
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.5.137 (proxied: 185.53.133.77)
----
Manual Page -- https://php.net/manual/en/language.namespaces.definition.php
Edit -- https://main.php.net/note/edit/130252
Del: integrated -- https://main.php.net/note/delete/130252/integrated
Del: useless -- https://main.php.net/note/delete/130252/useless
Del: bad code -- https://main.php.net/note/delete/130252/bad+code
Del: spam -- https://main.php.net/note/delete/130252/spam
Del: non-english -- https://main.php.net/note/delete/130252/non-english
Del: in docs -- https://main.php.net/note/delete/130252/in+docs
Del: other reasons-- https://main.php.net/note/delete/130252
Reject -- https://main.php.net/note/reject/130252
Search -- https://main.php.net/manage/user-notes.php