示例类:
class Example{
public static $ONE = [1,'one'];
public static $TWO = [2,'two'];
public static $THREE = [3,'three'];
public static function test(){
// manually created array
$arr = [
self::$ONE,
self::$TWO,
self::$THREE
];
}
}
Run Code Online (Sandbox Code Playgroud)
有没有办法在PHP中获取类静态成员变量数组而不像示例中那样手动创建它?
php ×1