search

Home  >  Q&A  >  body text

In php, the class name::class, what does it mean?

Excuse me: In the following PHP code, what does the class name::class mean?

protected $apiClass = [
    AccessToken::class,
    JsCodeToSession::class,
    CreateQrCode::class,
];
曾经蜡笔没有小新曾经蜡笔没有小新2700 days ago920

reply all(2)I'll reply

  • ringa_lee

    ringa_lee2017-06-30 09:56:29

    Class name with namespace

    reply
    0
  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-06-30 09:56:29

    Contains fully qualified name

    <?php
    namespace NS {
        class ClassName {
        }
        
        echo ClassName::class;  //输出NS\ClassName
    }
    ?>
    
    

    PHP official website address

    reply
    0
  • Cancelreply