PHP头条
热点:

php中const与define的差别


php中const与define的区别

(1)define不能定义在类中,而const必须定义在类中,并且const必须通过类名::变量名来进行访问;

(2)两者都是不能进行重新赋值

www.phpzy.comtrue/phprm/25616.htmlTechArticlephp中const与define的差别 php中const与define的区别 (1)define不能定义在类中,而const必须定义在类中,并且const必须通过类名::变量名来进行访问; (2)两者都是不能进行重新赋值...

相关文章

PHP之友评论

今天推荐