|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #67973 ::class notation is not documented?
Submitted: 2014-09-07 19:53 UTC Modified: 2018-12-30 05:11 UTC
From: ianbytchek at gmail dot com Assigned: girgias (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2014-09-07 19:53 UTC] ianbytchek at gmail dot com
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

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2014-09-08 05:15 UTC]
We've got this at, but it may need to be more prominent in the OOP section. Leaving open to ponder.
 [2014-09-08 08:01 UTC] ianbytchek at gmail dot com
Wow, it really is documented. Yes, definitely needs to be more prominent. If you search for ::class on it doesn't come up with this page. Googling for it also doesn't point to 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.
 [2018-12-30 05:11 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: girgias
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Mar 26 16:01:26 2019 UTC