Skip to content

php7.4+兼容问题 #4

Description

@augushong

Array and string offset access syntax with curly braces is deprecated

    public static function getLunarYearName($year) {
        $sky = ['庚', '辛', '壬', '癸', '甲', '乙', '丙', '丁', '戊', '己'];
        $earth = ['申', '酉', '戌', '亥', '子', '丑', '寅', '卯', '辰', '巳', '午', '未'];
        $year = (string)$year;
        return $sky[$year{3}] . $earth[$year%12];
    }

不支持中括号里的大括号写法.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions