go to bug id or search bugs for
Apparently we can do cool things with `class` since 5.5, like:
static::class // MyNamespace\ClassC when run in A
self::class // MyNamespace\ClassA when run in A
parent::class // MyNamespace\ClassB when run in C
MyClass::class // MyNamespace\MyClass
But there seem to be no references to it in the official documentation. There are some scattered things about it on the web, but not a lot. Is this official? Is it supported? Can this be documented?
Add a Patch
Add a Pull Request
We've got this at http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.class.class, but it may need to be more prominent in the OOP section. Leaving open to ponder.
Wow, it really is documented. Yes, definitely needs to be more prominent. If you search for ::class on php.net it doesn't come up with this page. Googling for it also doesn't point to php.net in a first few results. Perhaps adding more references at places like get_class, get_called_class and other similar functions would make things a lot better.