Default value for parameters with a class type can only be NULL

错误代码如下

function apiSuccess(mixed $data = [], string $msg = 'ok'): array
{
    return apiReturn(System::SUCCESS_DEFAULT_CODE, $msg, $data);
}

原因是mixed混合类型参数默认值必须为null

posted @ 2022-07-21 18:29  gltttt  阅读(257)  评论(0)    收藏  举报