要声明静态属性,将关键字static放在可见度修饰符后面,直接位于属性变量前面。
To declare a static property, place the keyword static after the visibility modifier, directly in front of the property variable.
$onlyOne 之前的静态修饰符将此变量关系到类本身。
The static modifier that precedes $onlyOne ties the variable to the class itself.
注释是可以添加到代码中的修饰符,可以用于包声明、类型声明、构造函数、方法、字段、参数和变量。
Annotations are modifiers you can add to your code and apply to package declarations, type declarations, constructors, methods, fields, parameters, and variables.
应用推荐