数组常量现在可以使用 define() 函数定义。 在PHP5.6,它们只能使用 const 关键字定义。 示例 <?php //define a array using define function define('animals', [ 'dog', 'cat', 'bird' ]); print(animals[1]); ?> 这将在浏览器产生输出以下结果 - cat 上一篇: PHP7飞船操作符 下一篇: PHP7匿名类