In php, the class name::class, what does it mean?
曾经蜡笔没有小新
曾经蜡笔没有小新 2017-06-30 09:54:29
0
2
915

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

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

reply all(2)
ringa_lee

Class name with namespace

曾经蜡笔没有小新

Contains fully qualified name

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

PHP official website address

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template